Bug #695: mysql_error can't fetch the error afte the database connection is closed
| From: | mlemos at acm dot org | Date: | Wed, 26 Aug 1998 02:06:05 +0000 |
| Subject: | Bug #695: mysql_error can't fetch the error afte the database connection is closed | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-583@lists.php.net to get a copy of this message | ||
From: mlemos@acm.org
Operating system: Any
PHP version: 3.0.3
PHP Bug Type: MySQL related
Bug description:
If for some reason you want to fetch the error of a failed operation
but you close the connection before fetching the error mysql_error says
that that the connection link is invalid.
The following script shows that provided that the example user xpto is not
authorized to access the database mysql.
BTW, the error message says user @localhost is not authorized. Shouldn't
it say user xpto@localhost is not authorized?
<?
if(($link=mysql_pconnect("localhost","xpto","")))
{
if(($select=mysql_select_db("mysql"))==0)
echo mysql_error();
mysql_close($link);
}
echo mysql_error();
?>
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net