Results 1 to 2 of 2
-
04-16-2004, 12:54 PM #1Junior Guru
- Join Date
- Aug 2003
- Location
- Walsall - UK
- Posts
- 177
PHP+mySQL... adding a number to an existing number
Hey guys
Say I have a number in the database e.g. 5
I have a variable in PHP thats 4.. I want to add that to the 5 in the database and make it 9...
Ratehr than getting the current number in the database, handling it with PHP, then putting the new one in..
Is there a way?
Thanks in advance
crE<<< Please see Forum Guidelines for signature setup. >>>
-
04-16-2004, 01:06 PM #2Web Hosting Master
- Join Date
- Dec 2002
- Location
- The Shadows
- Posts
- 2,925
mysql_query("UPDATE `tablename` SET number=number+".$phpnumber." WHERE number=5"); Should work
Dan Sheppard ~ Freelance whatever