|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[1998-09-02 13:33 UTC] zeev
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 18 08:00:01 2025 UTC |
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(); ?>