Ibrahim.I
Ibrahim.I

Reputation: 329

MySQL: can't insert a record because a foreign key issue

I have this schema enter image description here

when i'm trying to add a new isp_share record I get this error

enter image description here

although isp table has a record with id=3

enter image description here

what could be the problem?

Upvotes: 1

Views: 373

Answers (1)

Mihai
Mihai

Reputation: 26804

From documentation http://dev.mysql.com/doc/refman/5.0/en/create-table-foreign-keys.html

The parent and child tables must use the same storage engine..Corresponding columns in the foreign key and the referenced key must have similar data types

Also do a check of the other tables.

Upvotes: 2

Related Questions