1

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?

8
  • In your insert why is isp_idisp omitted? Commented Sep 24, 2013 at 17:00
  • @Mihai it's the last argument in the insert statement Commented Sep 24, 2013 at 17:03
  • Are you sure that you working on the right database and not on a copy? Commented Sep 24, 2013 at 17:04
  • @chumkiu I'm sure... I have a single copy of the database that I'm working on... I'm even working on PHPMyAdmin to insert the record Commented Sep 24, 2013 at 17:06
  • 2
    Are those table both on the same engine? Commented Sep 24, 2013 at 17:13

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.