#25138 [NEW]: mysql_connect example

From: Date: Tue, 19 Aug 2003 02:26:52 +0000
Subject: #25138 [NEW]: mysql_connect example
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969355919@lists.php.net to get a copy of this message
From: curt at zirzow dot dyndns dot org Operating system: PHP version: Irrelevant PHP Bug Type: Documentation problem Bug description: mysql_connect example Description: ------------ mysql_connect: example 1: <?php $link = mysql_connect("localhost", "mysql_user", "mysql_password") or die("Could not connect: " . mysql_error()); print ("Connected successfully"); mysql_close($link); ?> mysql_error() will not give a reason why the connect failed, according to: http://bugs.php.net/bug.php?id=24689 php4 will never give that message but php5 will. I havn't tested to see if this is true for php5. An alternative is to use $php_errormsg, but that can only used if php_ini.track_errors is set. Related Issues: Reason this occurs [closed] mysql_error() documentation [closed] http://bugs.php.net/bug.php?id=20743 Thanks, Curt -- Edit bug report at http://bugs.php.net/?id=25138&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=25138&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=25138&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=25138&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=25138&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=25138&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=25138&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=25138&r=support Expected behavior: http://bugs.php.net/fix.php?id=25138&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=25138&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=25138&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=25138&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25138&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=25138&r=dst IIS Stability: http://bugs.php.net/fix.php?id=25138&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=25138&r=gnused

« previous php.doc (#969355919) next »