tags:

views:

15

answers:

1

I have two databases, tvguide and episodes1.

Both are InnoDB, and I use Phpmyadmin to edit them.

I tried creating a foreign key between the "episode" field of episodes1 and tvguide, and this error message came up:

Error creating foreign key (check data types) : episode

How can I fix this and ensure both tables join? I have InnoDB set for both databases, so this shouldn't happen, but why?

A: 

It may be that you have defined the 'episodes' column differently in each table. That could cause the operation to fail. Perhaps you could post (possibly trimmed versions of) your table definitions here. Then we can say for certain.

Brian Hooper
These are the definitions for episodes1 table: http://pastebin.com/54Cc5TNg
whitstone86
And for the episode table on tvguide, table episodedata1: http://pastebin.com/AxWeHnkn
whitstone86
Hmmm. They both look the same to me. Perhaps you could try SHOW CREATE TABLE for each of the tables to see if they turn up different character sets or something of that kind.
Brian Hooper
Both are latin1 charsets.
whitstone86
Can you create the key by hand in a MySQL session? If so, the problem is with PHPMyAdmin, and I shall have to bow out and stop wasting your time. I have never got PHPMyAdmin even to start so I can't claim to be an expert at it.
Brian Hooper