error defining foreign key PhpMyAdmin

Posted by Ngounou lassale on Stack Overflow See other posts from Stack Overflow or by Ngounou lassale
Published on 2012-11-22T04:57:31Z Indexed on 2012/11/22 4:59 UTC
Read the original article Hit count: 111

Filed under:

I am new to PhpMyAdmin. I will like to create a foreign key for my tables. In fact i have create tableI with this structures(A as int(11) autoincrement, B as varchar) TableII ( A_2 as int(11) auto increment, B_2 as varchar, A as int(11). I have declared A as an index in tableII, now when i go to relationship view to precise A as a foreign key i always have this error

Erreur lors de la création de la clé étrangère sur ID_Ville (vérifiez le type des colonnes)

Erreur ALTER TABLE tb_quartier ADD FOREIGN KEY ( ID_Ville ) REFERENCES ingenieris2.tb_ville ( ID_Ville ) ON DELETE RESTRICT ;

Please Help

thanks!

© Stack Overflow or respective owner

Related posts about mysql-error-1064