longtone Posted May 5, 2008 Share Posted May 5, 2008 Is there a way to add a variable to an entry in one operation? ie: there is an entry in column 'points' with value = 11 there is a variable $morepoints = 6 I want to update the entry to 17, but without having to SELECT it, perform the sum and then UPDATE Quote Link to comment Share on other sites More sharing options...
trq Posted May 5, 2008 Share Posted May 5, 2008 UPDATE tbl SET points=points+6 WHERE id = 1; Quote Link to comment Share on other sites More sharing options...
longtone Posted May 5, 2008 Author Share Posted May 5, 2008 So simple Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.