Page 1 of 1

Decreasing / increasing a value

Posted: Fri Jan 09, 2009 8:35 pm
by Aki
I'm trying to update a database value by decreasing it each time I step into a certain page, but I'm not at all sure I'm on the right track. At least I'm trying.

As follows is the code as it is now, obviously nonworking.

Code: Select all

mysql_query("UPDATE tempurl_user SET user_adv_x - 1
WHERE id = '12'");

Re: Decreasing / increasing a value

Posted: Sat Jan 10, 2009 3:44 am
by sergio-pro
try this

Code: Select all

 
mysql_query("UPDATE tempurl_user SET user_adv_x = user_adv_x - 1
WHERE id = '12'");