Trigger to UPDATE after UPDATE?
Use a BEFORE
trigger instead, and set the updated
column assigning a value to NEW.updated
(this would be a simple assignment, not an UPDATE
). This way you won't trigger additional UPDATE
s.
Your trigger body will simply look like
SET NEW.updated = NOW()
I usually use AFTER
triggers only for modifying other tables, BEFORE
for modifying the new (or updated) row, or suppress DELETE
.