06-29-2009, 10:24 AM
[eluser]richthegeek[/eluser]
Hi,
If you ever need to toggle a boolean database column between 1 and 0, but don't know what value is at the time, you can use the following query:
It saves running a select query
Hope that helps someone!
Hi,
If you ever need to toggle a boolean database column between 1 and 0, but don't know what value is at the time, you can use the following query:
Code:
UPDATE `table` SET `column` = MOD( `column` + 1, 2 ) WHERE ...
It saves running a select query

Hope that helps someone!