Syntax error sur IF successifs
Bonjour à tous,
Je crée sous PHPMyAdmin un trigger devant comporter 3 tests successifs :
Code:
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; |
Seulement lorsque je tente de l'exécuter, j'ai une belle Erreur de syntaxe :
Code:
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
Sauriez-vous pourquoi j'ai ce soucis et comment le corriger ?
Merci d'avance,