I just created a test table with the 3 fields and used:
where visits=visits+1
without the trailing comma and everything worked fine.
Cal
http://www.calevans.com
-----Original Message-----
From: Jamie [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 23, 2001 3:52 AM
To: [EMAIL PROTECTED]
Subject: Update and change a value
I was wondering if anyone can explain why this SQL command doesn't work
UPDATE users SET visits=visits+1, WHERE user_id='$user' AND
password='$password'
the $user and $password are variables that are inserted by PHP, what I'm
specifically looking at is the visits=visits+1 which is simple enough and
taken virtually from the mySQL documentation. The line below works fine in
which I set a set value.
UPDATE users SET visits=4 WHERE user_id='$user' AND password='$password'
Any help would be appreciated
Jamie
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php