Réponse acceptée !
pouuuuf ! merde alors ca fait 10 minutes que je suis entrain d'écrire le message et voila qu'il n'affiche rien :!
le type de la table doit etre innodb et puis le format est :
[Code]
CREATE TABLE parent(id INT NOT NULL,
PRIMARY KEY (id)
) TYPE=INNODB;
CREATE TABLE child(id INT, parent_id INT,
INDEX par_ind (parent_id),
FOREIGN KEY (parent_id) REFERENCES parent(id)
ON DELETE CASCADE
) TYPE=INNODB;
[/Code]
ON DELETE CASCADE
ON UPDATE CASCADE
sert pour l'intérgrité référentielle .
Voici deux liens à étudier :
http://www.nexen.net/docs/mysql/annotee/alter-table.php
http://www.nexen.net/docs/mysql/annotee/innodb-foreign-key-constraints.php