Answer the question
In order to leave comments, you need to log in
Why do I get a syntax error when creating a trigger?
I create a trigger through the PHP My ADMIN interface. I export from it, paste it back into it and ... a syntax error!
here it goes with a bang
CREATE TRIGGER `after_deal_creating` BEFORE INSERT ON `deals`
FOR EACH ROW INSERT INTO `notifications`
SET `new_quote_status` = NEW.`quote_status` ,
`deal_id` = NEW.`id` ,
`broker_id` = NEW.`broker_id` ,
`creator_id` = NEW.`creator_id` ,
`box_user_id` = NEW.`box_user_id`
CREATE TRIGGER `after_deal_updating` BEFORE UPDATE ON `deals` FOR EACH ROW IF NEW.`quote_status` <> OLD.`quote_status` THEN INSERT INTO `notifications`
SET `new_quote_status` = NEW.`quote_status` ,
`deal_id` = OLD.`id` ,
`broker_id` = NEW.`broker_id` ,
`creator_id`= OLD.`creator_id`,
`box_user_id`= NEW.`box_user_id`; // вот здесь ошибка!!
END IF;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question