RE: [PHP] PHP + MySQL problem (strange behavior)
| From: | Javier Muniz | Date: | Fri, 07 Dec 2001 23:57:04 +0000 |
| Subject: | RE: [PHP] PHP + MySQL problem (strange behavior) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-77091@lists.php.net to get a copy of this message | ||
Unfortunately, mysql returns no error string. MySQL doesn't appear to think
it's
an error, as it does apply changes to the row I'm trying to change, it
simple isn't
applying the CORRECT change to said row :)
-Javier
-----Original Message-----
From: David Robley [mailto:huntsman@www.nisu.flinders.edu.au]
Sent: Wednesday, December 05, 2001 4:59 PM
To: Javier Muniz; 'php-general@lists.php.net'
Subject: Re: [PHP] PHP + MySQL problem (strange behavior)
On Thu, 6 Dec 2001 08:32, Javier Muniz wrote:
> Hello,
>
> I'm having trouble determining what's going wrong with a MySQL query
> that I'm doing from PHP. Now before you go blaming MySQL read on :)
>
> I have a table with the following columns:
> id (int)
> name (varchar 20)
> starttime (int)
> duration (int)
>
> now, i have a row that has a starttime of 60, when i attempt to do the
> following update with PHP, it sets it to 0:
>
> "UPDATE mytable SET starttime=starttime-30 WHERE name = 'myname'"
>
> but when I run it from the MySQL command line, copy/pasted from the
> code, it sets the value of starttime to 30 as expected.
>
> Anyone have any clue why this is?
mysql_error() is a good debugging tool; it will return an error string
that may be useful.
--
David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA
A waist is a terrible thing to mind.