[ENG] Foreign key creation problem

[ENG] Foreign key creation problem

am 11.09.2006 09:06:57 von Bob Bedford

I'm trying to create a foreign key for a table but I'm having troubles: here
is the error message:
Error in foreign key constraint of table xxx/#sql-1e4_34:\n FOREIGN
KEY(`IdCollaborateur`) REFERENCES
`collaborateur`(`IdCollaborateur`):\nCannot find an index in the referenced
table where the\nreferenced columns appear as the first columns, or column
types\nin the table and the referenced table do not match for constraint

My tables:
tbl report (Where I try to create the FK)
- idreport mediumint(9) unsigned auto_increment
- IdColl mediumint(9)
- report text

tbl collaborateur:
- IdCollaborateur mediumint(9) unsigned auto_increment
- name varchar(50)

Thanks for help.

Bob

Re: [ENG] Foreign key creation problem

am 11.09.2006 09:15:42 von Bob Bedford

Sorry, I found the answer:
was only that I set the idcoll as unsigned in tbl collaborateur and didn't
in the table report.

Need more than 5 coffees on monday morning....

Bob