note 88502 added to function.mysql-error

From: Date: Tue, 27 Jan 2009 10:46:48 +0000
Subject: note 88502 added to function.mysql-error
Groups: php.notes 
Request: Send a blank email to php-notes+get-149828@lists.php.net to get a copy of this message
<?php $db1 = mysql_connect('host1', 'user', 'pass'); $db2 = mysql_connect('host2', 'user', 'pass'); mysql_query("FAIL", $db1); var_dump(mysql_error()); ?> The documentation is correct; but you wouldn't expect this. You will get: string(0) "" It returns the error on the last opened mysql connection: $db2; and there was no error there. So if you give a connection resource to mysql_query() (or some other mysql_ function) make sure you also give that resource to mysql_error(). ---- Server IP: 89.248.170.61 Probable Submitter: 82.93.241.107 ---- Manual Page -- http://www.php.net/manual/en/function.mysql-error.php Edit -- https://master.php.net/note/edit/88502 Del: integrated -- https://master.php.net/note/delete/88502/integrated Del: useless -- https://master.php.net/note/delete/88502/useless Del: bad code -- https://master.php.net/note/delete/88502/bad+code Del: spam -- https://master.php.net/note/delete/88502/spam Del: non-english -- https://master.php.net/note/delete/88502/non-english Del: in docs -- https://master.php.net/note/delete/88502/in+docs Del: other reasons-- https://master.php.net/note/delete/88502 Reject -- https://master.php.net/note/reject/88502 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#149828) next »