Bonjour à tous,
Je crée sous PHPMyAdmin un trigger devant comporter 3 tests successifs :
Seulement lorsque je tente de l'exécuter, j'ai une belle Erreur de syntaxe :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9 IF NEW.accounts_id IS NULL THEN SET NEW.accounts_id = NEW.id; END IF; IF NEW.contacts_id IS NULL THEN SET NEW.contacts_id = NEW.id; END IF; IF NEW.accounts_contacts_id IS NULL THEN SET NEW.accounts_contacts_id = NEW.id; END IF;
Sauriez-vous pourquoi j'ai ce soucis et comment le corriger ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part MySQL a répondu: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IF NEW.contacts_id IS NULL THEN SET NEW.contacts_id = NEW.id; END IF; IF' at line 4
Merci d'avance,
Partager