Decreasing / increasing a value

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Aki
Forum Newbie
Posts: 8
Joined: Fri Jan 09, 2009 5:38 pm

Decreasing / increasing a value

Post 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'");
User avatar
sergio-pro
Forum Commoner
Posts: 88
Joined: Sat Dec 27, 2008 12:26 pm

Re: Decreasing / increasing a value

Post by sergio-pro »

try this

Code: Select all

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