database client version: libmysql - mysqlnd 5.0.12 - dev - 20150407
The trigger code below
CREATE DEFINER=` root ` @ ` localhost ` TRIGGER ` fan_insert ` AFTER INSERT ON ` fan ` FOR EACH ROW INSERT INTO ` user_info ` (` userid `) VALUES NEW. ` userid ` ON DUPLICATE KEY UPDATE ` redundance `=` redundance `
I use phpmyadmin for adding triggers, where is the problem?
CodePudding user response:
The CREATE DEFINER=` root ` @ ` localhost ` TRIGGER ` fan_insert `
AFTER INSERT ON ` fan `
FOR EACH ROW
INSERT INTO ` user_info ` (` userid `) VALUES NEW. ` userid ` ON DUPLICATE KEY UPDATE ` redundance `=` redundance `
Code so convenient you see
CodePudding user response:
I am fan insert the data in the table at once is inserted into the article N, is not a a insertCodePudding user response:
Mysql currently only the article bore the touch hair (a insert 10, trigger 10 times), FOR EACH ROW the meaning of the keyword is clear theSo is the VALUES (), lost you handle size