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

From: Date: Thu, 03 Mar 2011 13:58:11 +0000
Subject: note 102742 rejected from function.mysql-select-db by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-177528@lists.php.net to get a copy of this message
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?

« previous php.notes (#177528) next »