Jump to content

Changing values in tables


Fira

Recommended Posts

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.