Who can give an example of a trigger when, when UPDATE is on table1 , the information of the updated record is added to table2 . Question in syntax and query construction
DELIMITER $$ CREATE TRIGGER update BEFORE UPDATE ON log FOR EACH ROW BEGIN INSERT INTO recordlog Set from = NEW.IdtoUserRecordstouser, to = NEW.IdUserRecordstouser, status = 0, id_record = NEW.IdRecordstouser; END; $$ DELIMITER ;