I wanto to create a trigger in MySQL but it displays an error message when I run the creation code:
CREATE TRIGGER before_employee_update
BEFORE UPDATE ON trigger
FOR EACH ROW BEGIN
update users
SET username= 'krishna',
password= 'abc';
END
Error is:
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 'trigger FOR EACH ROW BEGIN INSERT INTO users SET username= 'kr' at line 2
This is the code the error points to:
BEFORE UPDATE ON trigger
^^^^^^^