I want this to be like this.
I have an ENUM column with 0 AND 1, i want to toggle between these two values on each query.
UPDATE settings
SET state = 1 IF state = 0
ELSE IF state = 0
SET STATE = 1 WHERE id = '$id';
I tried this, but it leaves the column empty.
UPDATE settings SET state = IF(state=1, 0, 1)
Thanks.