I have created a trigger in my database to fire after update. I get an error message pop up when I try to update a field.
can't update table in stored function/trigger because it is already used by statement which invoked this stored function/trigger
Here is mysql. I have added it to the Triggers section
UPDATE SiteStaff p, (SELECT StaffID, SUM(Holiday) as mysum
FROM SiteStaff GROUP BY StaffID) as s
SET p.Total = s.mysum
WHERE p.StaffID = s.StaffID
I guess it is because for some reason the trigger executes but doesn't close once done?