I would like to update processed value when the update happens on a row. If the processed <> 0 then update processed=1 else processed=0
Syntax error...
SQL Error [1064] [42000]: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '//' at line 1
My code:
CREATE TRIGGER users_after_update
AFTER update ON users
FOR EACH ROW
BEGIN
IF NEW.processed <> 0 THEN
UPDATE users SET new.processed=1;
ELSE
UPDATE users SET new.processed=0;
END IF;
END;