I typed this code into mysql and it gave an error:
CREATE TRIGGER delete_vote_topic BEFORE DELETE ON vote_topic
FOR EACH ROW BEGIN
DELETE FROM vote_option WHERE vote_topic_id = OLD.id;
DELETE FROM vote_option_votes WHERE vote_topic_id = OLD.id;
END;
the error was:
#1064 – You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ” at line 3
Anybody knows what I’m doing wrong?
Try using a delimiter