RE: [PHP] Locking mysql tables with PHP
| From: | Jay Blanchard | Date: | Tue, 25 Nov 2003 14:02:15 +0000 |
| Subject: | RE: [PHP] Locking mysql tables with PHP | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-170882@lists.php.net to get a copy of this message | ||
[snip]
> is there a way I can get a number and increment it all in one query
> then?
>
> UPDATE tblFoo SET value = (value+1) WHERE conditions
>
Hmm.. my bad - I get that bit, but can I do:
SELECT value WHERE conditions UPDATE tblfoo SET value= (value+1)
[/snip]
I see where the confusion may be now...where is that value you were
looking for? Its in the conditions...
UPDATE tblFoo SET value = (value + 1) WHERE value = 'blork' AND
otherStuff = 'fark'