Chez moi, il marche bien, mais là, il me dit :
#1235 - This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table'
Le code :
Code : Tout sélectionner
CREATE TRIGGER trg_autoi_order
BEFORE INSERT ON `cat`
FOR EACH ROW
BEGIN
SET NEW.`cat_order` = (SELECT (MAX(`cat_order`)+1) FROM `cat` WHERE `type` = NEW.`type`);
END
Je ne fait pas de multiple actions comme semble dire MySQL ...