|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Is there a way of getting mysql to add a value to an already set data field without having to select the current value, add the increment in php then update the field with the new value.
I want to take an existing 'count' field and add one to it, but i want to do it in one request to the database. |
|
#2
|
|||
|
|||
|
update table set field=field+1 where foo;
|
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > Incrementing existing datafield by a set value - quick way... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|