Re: Increment a value in a MySQL database with one query?
| From: | mnc at stoic dot net | Date: | Sat, 16 Mar 2002 09:02:02 +0000 |
| Subject: | Re: Increment a value in a MySQL database with one query? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-88739@lists.php.net to get a copy of this message | ||
On Sat, 16 Mar 2002, Kevin Stone wrote:
> Is there a MySQL function that I can use to increment the integer value of a row entry with one
> query?
>
> Here's the combined PHP and SQL in psuedo code form...
> UPDATE mytable SET myval++
>
> Something like that. So I dont have to pull the value from the database, increment it, then
> post it back to the database. Any help will be greatly appreciated,
UPDATE mytable SET myval=myval+1
miguel