Create a foreign key on phpmyadmin

-1

I need to create a foreign key in a database that I have in phpmyadmin. The database consists of 4 tables, all of them already contain data. One of the three tables is related to the rest of them. All the columns in the main table have an index but an error appears when trying to create the foreign keys. Any solution?

This is the error:

    
asked by Lara 11.04.2018 в 15:03
source

1 answer

3

Well as the error says you have to verify that the data you are entering is correct, specifically the field ID_STATE, you have to place a ID_STATE that is in the table ANNEX otherwise you will not be able to do the insert since it is is verifying that there is the same.

    
answered by 11.04.2018 / 15:17
source