删除后的MYSQL TRIGGER - 从多个表中删除数据

时间:2016-07-23 06:01:00

标签: php mysqli

我想从触发器中删除多个表中的数据,但似乎我的语法不正确。

{    DELIMITER $$
     CREATE TRIGGER `delete_store`
     AFTER DELETE ON `menufacture`
     FOR EACH ROW
   BEGIN
      DELETE FROM company WHERE OLD.id = menufacture_id ; 
      DELETE FROM product WHERE OLD.id = product.menufacture_id;
      DELETE FROM menufacture WHERE OLD.id = menufacture.parent ; 
   END $$`
}

0 个答案:

没有答案