Increment an exisitng value in Mysql

To increment or decrement and existing number in a table (you do not need to read the value first)  please read on : Increment the value ‘timer‘ by one for the row in table ‘movies‘ where ‘movie_id‘ is ’24’, use:

UPDATE movies SET timer=timer+1 WHERE movie_id=24

Note  to decrement use timer=timer-1


You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

AddThis Social Bookmark Button

Leave a Reply

To prove that you're not a bot, enter this code
Anti-Spam Image