[nycphp-talk] if mysql_query() produces an error....
Phil Powell
soazine at erols.com
Thu Aug 21 17:27:37 EDT 2003
Re: [nycphp-talk] if mysql_query() produces an error....Then I'm confused. Why is it then that mysql_select_db() will bomb after the user attempted to enter erroneous data into mysql_query()? That is, the user enters bad data within mysql_query(); it throws mysql_error() and delivers the page to the user; the user attempts AGAIN to enter somethng and then mysql_select_db dies! Why does that occur?
Phil
----- Original Message -----
From: Mauricio Sadicoff
To: NYPHP Talk
Sent: Thursday, August 21, 2003 5:13 PM
Subject: Re: [nycphp-talk] if mysql_query() produces an error....
On 8/21/2003 17:04, "Phil Powell" <soazine at erols.com> scribbled:
...is it not true that mysql_error() will persist? I have a case on a site where the admin enters a new user and, for some reason, does it wrong, producing a mysql_error() instance. If they try to, again, enter this user immediately after the error is shown, mysql_select_db dies.
I am thinking that this can be resolved by clearing mysql_error() immediately after the error is reported. How can that be done, or am I way offbase here?
It does not "persist", meaning it will only show the latest error, according to the manual, on page:
http://us2.php.net/manual/en/function.mysql-error.php
They also mention that it will not be changed if the user does not have permission to do what you intend or if the connection has been closed already.
Good luck,
Mauricio
---
Mauricio L. Sadicoff
mlevy at hypersol.com
"Peace of mind isn't at all superficial, really," I expound. "It's the whole thing. That which produces it is good maintenance; that which disturbs it is poor maintenance. What we call workability of the machine is just an objectification of this peace of mind. The ultimate test is always your own serenity." - Zen and the Art of Motorcycle Maintenance.
------------------------------------------------------------------------------
_______________________________________________
talk mailing list
talk at lists.nyphp.org
http://lists.nyphp.org/mailman/listinfo/talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20030821/e8e898c2/attachment.html>
More information about the talk
mailing list