note 90557 deleted from mysqli.connect by danbrown

From: Date: Tue, 28 Apr 2009 12:55:18 +0000
Subject: note 90557 deleted from mysqli.connect by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-153898@lists.php.net to get a copy of this message
Note Submitter: Jeroen Versteeg ---- Note that both "mysqli_connect" and "mysqli::__construct" produce a warning when bad credentials are used (just like the old mysql_ functions I think), so you are forced to use @ to silence these, and then check for connect_error: <?php $c = @new mysqli( $dbHost, $dbUser, $dbPass, $dbName ); // OR @mysqli_connect( $dbHost, $dbUser, $dbPass, $dbName ); if ( $c->connect_error ) // this only works in PHP >= 5.2.9 // OR if ( mysqli_connect_error() ) ?>

« previous php.notes (#153898) next »