I'm experimenting with Foreign Keys to maintain referential integrity. I have just added a Foreign Key to one of my tables, but now when I attempt to add a new record, I get this error:

#23000Cannot add or update a child row: a foreign key constraint fails (`fccamp/families`, CONSTRAINT `FK_Campers` FOREIGN KEY (`ID`) REFERENCES `campers` (`FamilyID`) ON DELETE CASCADE ON UPDATE CASCADE)

Did I get something backwards here? Does a child record have to exist before I can add a parent record? I thought that a Foreign key referred to a child record? In other words, the "Foreign" component is the child table. Is that not right? If it is, how do I add records?

Thanks,
Jesse

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to