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? Link to comment https://forums.phpfreaks.com/topic/21941-changing-values-in-tables/ Share on other sites More sharing options...
fenway Posted September 25, 2006 Share Posted September 25, 2006 SET variable2 = variable2 + 5 Link to comment https://forums.phpfreaks.com/topic/21941-changing-values-in-tables/#findComment-98137 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.