I am trying to set up an audit table for changes to a table. I found what I thought was a good tutorial but it gives an error when creating the triggers in phpmyadmin.
The error is
#1235 - This version of MySQL doesn’t yet support ‘multiple triggers with the same action time and event for one table’
I have Googled this and am none the wiser as to how to resolve it as I am a newbie at triggers.
This is the sql that I have
CREATE TRIGGER ai_data AFTER INSERT ON interest
FOR EACH ROW
BEGIN
INSERT INTO interest_log (action,id,timestamp,member,surname,town,county,country,period)
VALUES('insert',NEW.id,NOW(),NEW.member,NEW.surname,NEW.town,NEW.county,NEW.country,NEW.period);
END$$
CREATE TRIGGER au_data AFTER INSERT ON interest
FOR EACH ROW
BEGIN
INSERT INTO interest_log (action,id,timestamp,member,surname,town,county,country,period)
VALUES('insert',NEW.id,NOW(),NEW.member,NEW.surname,NEW.town,NEW.county,NEW.country,NEW.period);
END$$
CREATE TRIGGER ad_data AFTER INSERT ON interest
FOR EACH ROW
BEGIN
INSERT INTO interest_log (action,id,timestamp,member,surname,town,county,country,period)
VALUES('insert',OLD.id,NOW(),OLD.member,OLD.surname,OLD.town,OLD.county,OLD.country,OLD.period);
END$$
This creates the first trigger properly and then aborts with the error message above.
Can anyone help in simple language please?