Reputation: 233
CREATE TRIGGER `update_hidden` AFTER UPDATE ON boutique
FOR EACH ROW
BEGIN
UPDATE `items` SET hidden = NEW.hidden WHERE boutique_id = NEW.id;
END
I have a table boutique and table items, both have field hidden
, after executing this code i get a syntax error, what is my mistake?
Upvotes: 1
Views: 56
Reputation: 29051
Remove spaces between ROW BEGIN:
CREATE TRIGGER `update_hidden` AFTER UPDATE ON boutique
FOR EACH ROW BEGIN
UPDATE `items` SET hidden = NEW.hidden WHERE boutique_id = NEW.id;
END
Upvotes: 1