Fira Posted September 25, 2006 Share Posted September 25, 2006 How do you change the values of variables? I know one method would be[quote]UPDATE user SET variable1 = '15', variable2 = '60' WHERE userid = '$userid'";[/quote]But what if I wanted to add 5 to variable2? Would I need to first retrieve variable2, add 5 to it, then set the new value to variable2, or is there an easier MySQL command, like UPDATE user ADD? Quote Link to comment Share on other sites More sharing options...
fenway Posted September 25, 2006 Share Posted September 25, 2006 SET variable2 = variable2 + 5 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.