cannot add or update a child row a foreign key constraint fails mysql
Hi I'm pretty new to mysql and have tried some of the other suggested
fixes for this problem but had no luck! I'm trying to create a foreign key
between the tables application and customer but when i run my program I
get the error "cannot add or update a child row a foreign key constraint
fails mysql". My program is a data capture form and is meant to insert the
information into the database. My tables are made up as follows
application table
applicationid mediumint(9)
covertype varchar(100)
customeremail varchar(100)
customertable
customeremail varchar(100)
customerfname varchar(100)
applicationid mediumint(9)
i tried to set up a foreign key a few different ways e.g. alter table
application add foreign key(customeremail) references
customer(customeremail) alter table customer add foreign key
(applicationid) references application(applicationid)
but this didn't work i'd appreciate any advice on how to solve the issue
No comments:
Post a Comment