Toggle a MySQL field between 0 and 1
Here's a simple example of how to toggle an integer (most often a tinyint in my case) field in MySQL between 0 and 1:
UPDATE table SET int_field=MOD(int_field+1,2) WHERE id=123
UPDATE table SET int_field=MOD(int_field+1,2) WHERE id=123
