Posted by Gordon Burditt on 11/22/05 00:16
>> is there a simple (quick) way to increase the value of an integer
>> field in a nominated row by 1 other than first having to retrieve the
>> value and then UPDATE the appropriate field? - similar to doing a
>> $Variable++ in PHP?
>
>Why not use the autoincrement feature of MySql?
Autoincrement doesn't increment a field in an existing row.
It assigns a value to a field in a *NEW* row being inserted.
update hitlog set hitcount = hitcount + 1 where host = 'www.google.com';
Gordon L. Burditt
Navigation:
[Reply to this message]
|