note 102742 rejected from function.mysql-select-db by danbrown

[email protected]
Newsgroups php.notes
Message-ID <[email protected]>
Note Submitter: reinelt dot chris at web dot de 

----

<?php
$mysql = mysql_connect('localhost','root','');
if(!$mysql) { 
	die ('<font color="#990000">Fehler beim Verbinden mit der Datenbank ! :</font><br> ' .mysql_error()); } else {
		echo '<font color="#669900">Sie haben erfolgreich eine Verbindung hergestellt ! <br></font>'; }
		
$mysqldb = mysql_select_db('lernen',$mysql);
if(!$mysqldb) {
	 die ('<font color="#990000">Die Datenbank kann nicht benutzt werden :</font> ' . mysql_error()); } else {
		echo '<font color="#669900">Die angegebene Datenbank existiert ! <br></font>'; }
?>

Is there a bug in the code?
or is it right?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.