I need the right syntax for mysql trigger I’m using version 5.1
and the syntax error alwys apper when I wrote sql statment
DELIMITER $$
CREATE TRIGGER blood_year
AFTER INSERT ON donor
FOR EACH ROW
BEGIN
INSERT INTO blood_donation (donation_year)VALUES
(YEAR(NOW()));
END$$
any idea??
Try adding another “DELIMITER” statement at the end: