I have this trigger
CREATE TRIGGER checkcollision AFTER UPDATE ON players BEGIN
SELECT RAISE(ABORT, 'collision') FROM walls WHERE NEW.x=x AND NEW.y=y;
END;
mysql 5.1.72-0ubuntu0.10.04.1 (Ubuntu)
But I am getting a syntax error, and I don't see where...
EDIT:
DELIMITER //
CREATE TRIGGER checkcollision AFTER UPDATE ON players BEGIN SELECT RAISE(ABORT, 'collision') FROM walls WHERE NEW.x=x AND NEW.y=y; END//
DELIMITER ;
this still got a syntax error
EDIT2:
I think I need the old syntax from here: https://dev.mysql.com/doc/refman/5.0/en/commit.html
I don't know how to complete the code though...
START TRANSACTION;
SELECT p.* FROM players p WHERE EXISTS (SELECT w.* FROM walls w WHERE w.x=p.x AND w.y=p.y);
COMMIT;
ROLLBACK;