Click to See Complete Forum and Search --> : MySQL error!!!! please help


j-dearden
03-09-2007, 10:16 AM
Hey all

i have a insert query that inserts a record into my database. however once the wuery has inserted i am prompted with the following message :-

Cannot add or update a child row: a foreign key constraint fails

however the record has been added. could some one plese help i am so confused.

regards

John

cafrow
03-10-2007, 04:55 PM
Might help if you post the query.

jasonahoule
03-10-2007, 05:28 PM
Kind of sounds like you are trying the insert twice.

j-dearden
03-11-2007, 05:12 AM
Cheers for the replies but i have figured it out. The problem was i was trying to insert a value into the child table that didnt exist in the parent. simple but i can imagine common mistake.