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 ; 
  • The documentation did not help? Please clarify what exactly is not clear. - smackmychi
  • Everything is clear, but for some reason the trigger is not created. Updated the question - Jony
  • That was the problem. Edited the question by adding a sub - question - Jony
  • @Oleg Ponomarchuk please mark the question as correct in order to keep order. - smackmychi

1 answer 1

The problem is that you use the update keyword in the trigger name.