Updating a record with math and division
| From: | Todd Williamsen | Date: | Fri, 28 Dec 2001 22:26:58 +0000 |
| Subject: | Updating a record with math and division | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-15250@lists.php.net to get a copy of this message | ||
Ok....
So to update a record lets say...
I have a current value of 150 and the new value will be 250 now how would I
total them to equal 400?
I was thinking
$sql = "UPDATE $table value1 = value1 + ?
is that correct? how do you update it with simple math?
What about division...
take the current value in the database + the new value divided by another
number, lets say another field