[PHP-DEV] Bug #695: mysql_error can't fetch the error afte the database connection is closed From: mlemos <email protected>
Date: 08/25/98

From: mlemos <email protected>
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  <email protected> is not authorized. Shouldn't
it say user xpto <email protected> 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 <email protected>
For help: php-dev-help <email protected>