attaboy Posted May 25, 2012 Share Posted May 25, 2012 MySQL version 5.5.16 When I run this code I create a trigger on one table that makes updates to 2 other tables whenever I change the code column on the first table. It works fine for me but I gave this code to a friend and when she tries it she gets an error message back saying that her version of MySQL won't support changes to multiple tables from a single trigger. We both installed MySQL around the same time she uses wamp I use xampp. Is it possible this could be fixed by changing an ini setting? delimiter // mysql> CREATE TRIGGER -> CodeChange_au -> AFTER UPDATE -> on country -> FOR EACH ROW -> BEGIN -> set @code_new = NEW.Code; -> set @code_old = OLD.Code; -> UPDATE city SET CountryCode = @code_new -> WHERE CountryCode = @code_old; -> UPDATE CountryLanguage SET CountryCode = @code_new -> WHERE CountryCode = @code_old; -> END// Link to comment https://forums.phpfreaks.com/topic/263146-changes-to-multiple-tables-with-one-trigger/ Share on other sites More sharing options...
attaboy Posted May 26, 2012 Author Share Posted May 26, 2012 she just had a leftover trigger that she needed to drop. Link to comment https://forums.phpfreaks.com/topic/263146-changes-to-multiple-tables-with-one-trigger/#findComment-1348731 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.