Phpmyadmin mysql foreign key problem
- by alan
Hey guys i'm using phpmyadmin (php & mysql) and i'm having alot of trouble linking the tables using foreign keys.
I'm getting negative values for the field countyId (which is the foriegn key). However it is linking to my other table fine and it's cascading fine.
So when I go to add data there will be a drop box for the CountyId and the values will look something like this,
" -1
1- "
Here is my alter statement,
ALTER TABLE Baronies
ADD FOREIGN KEY (CountyId)
REFERENCES Counties (CountyId)
ON DELETE CASCADE