Re: mysql_error() problem?
| From: | Tyler Longren | Date: | Wed, 06 Aug 2003 20:35:24 +0000 |
| Subject: | Re: mysql_error() problem? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-158550@lists.php.net to get a copy of this message | ||
hmmm...perhaps that was it. When I had this issue before, someone told me
to check mysql_affected_rows() when using issuing an UPDATE query. I'll
give that a shot.
Thanks!
Tyler
----- Original Message -----
From: "CPT John W. Holmes" <holmes072000@charter.net>
To: "Tyler Longren" <tyler@jdhost.com>; <php-general@lists.php.net>
Sent: Wednesday, August 06, 2003 3:35 PM
Subject: Re: [PHP] mysql_error() problem?
> From: "Tyler Longren" <tyler@jdhost.com>
> > I'm running an UPDATE query on my table. After executing the query, I
> check
> > mysql_error() to see if there's any errors:
> > if (mysql_error() == "") {
> > // success
> > }
> > else {
> > // failure
> > }
> >
> > mysql_error() is always empty even if the query didn't succeed. So it
> > always thinks it succeeds. I remember having this problem once quite a
> > while ago. I remember somebody telling me that it had something to do
> with
> > UPDATE. Is there a better way to check for errors?
>
> Please define "didn't succeed"... There is a difference between the query
> "generated an error" which is caught with mysql_error() and the query "did
> not affect any rows" which is caught by mysql_affected_rows().
>
> ---John Holmes...
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>