Hi,
I have used databases from quite some time but this is my first attempt to build a large one on my own. I have an issue that I cannot think my way through to resolve.
I am building a database that is essentially a whole management system for dog breeders. And my whole problem is in one of the main table that houses the list of dogs. Essentially, I need this table to be a master table of which all other tables pull from......including the health profile, the whelping profile, the show log profile, the pedigree, etc.
But the problem lies when We are adding dogs into it. Each dog is connected to 2 other dogs from the same table (the parents) thus creating a loop. I keep getting errors yet I need to pull out from that same table.
Here is an example of part of the error I get when inserting data through phpmyadmin.
MySQL said: Documentation
#1452 - Cannot add or update a child row: a foreign key constraint fails (`joomla2`.`mbp_dogs`, CONSTRAINT `mbp_dogs_ibfk_7` FOREIGN KEY (`breeding_id`) REFERENCES `mbp_whelpingprofile` (`id`))
It took me awhile to realize that it was some sort of looping issue. I am also using the joomla component "Fabrik" to build the system and the error started in that component. After a while I realized it was originating in the actual database.
Is there a way of building extra tables, of a set of commands I can use to allow me to insert the mother and father into the same master table. It is okay if it has to be more than a single step process. I just cannot think my way through this one!
Thanks in advance for your suggestions.