RE: [PHP] Best way to increment an integer column in mysql
| From: | Rich Gray | Date: | Thu, 11 Dec 2003 10:41:59 +0000 |
| Subject: | RE: [PHP] Best way to increment an integer column in mysql | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-172452@lists.php.net to get a copy of this message | ||
> I was wondering if there is a php / mysql function call that will
> increment an integer column in a database.
> ie. the equivalent to
> $foo++;
>
Hi John
Well you can specify the column as auto_increment to let MySQL handle the
incrementation else I suppose - mysql_query('update mytable set
my_int_column = my_int_column + 1 where blah blah ...');
HTH
Rich