Re: Increment a value in a MySQL database with one query?
| From: | Kevin Stone | Date: | Sat, 16 Mar 2002 09:17:42 +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-88740@lists.php.net to get a copy of this message | ||
*LOL* I didn't think it would be that simple.. but yup.. it works. Maybe I
should test these things out before I open my stupid mouth. Thanks.
-Kevin
----- Original Message -----
From: <mnc@stoic.net>
To: "Kevin Stone" <kevin@helpelf.com>
Cc: <php-general@lists.php.net>
Sent: Saturday, March 16, 2002 2:02 AM
Subject: Re: [PHP] Increment a value in a MySQL database with one query?
> 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
>