Hi all, I'm trying to create a trigger that monitor changes on a table and then insert those change to another table as follows
CREATE TRIGGER userChangePasswd
BEFORE UPDATE ON originalTable
FOR EACH ROW
BEGIN
INSERT INTO logs (email,clear,name ) SELECT email,clear,name FROM originalTable
END
mysql keeps showing the following error
ERROR 1064 (42000): 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 'INSERT INTO logs (email,clear,name ) SELECT email,clear,name FROM ' originalTable at line 5
the following statement works very file with a where clause criteria
INSERT INTO logs (email,clear,name ) SELECT email,clear,name FROM originalTable
what's worng with the insertion statement within the trigger any ideas, Thanks in advance