开发者

MySQL Trigger Not working

I've created simple trigger to create cloud tabl开发者_C百科e (MyISAM table just to perfor FULL TEXT searches) however it's not working (the data is not being added).

DELIMITER ||

DROP TRIGGER IF EXISTS `table_cloud` ||

CREATE TRIGGER `table_cloud` AFTER INSERT ON `table`
FOR EACH ROW 
BEGIN
    INSERT INTO `table_cloud` SELECT `id`, `name`, `description` FROM `table` WHERE id = LAST_INSERT_ID();
END;
||
DELIMITER ;

Any suggestions?


Use NEW.ID instead of LAST_INSERT_ID() (NEW contains all columns values of the newly inserted row in 'table')

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜