-
SitePoint Zealot

Add instead of update in MySQL
Is there a way to use update to add a number to a database field instead of replacing it.
For example currently when I update a field containing a 5 with the number 6 it just replaces the 5 with a 6.
I'd really like it to just add the new number to the existing one - in this case making 11.
Any one know how?
Cheer
Dave
-
UPDATE TABLE_NAME SET FIELD_NAME = FIELD_NAME + NEW_VALUE WHERE CRITERIA_IS_MET
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks