MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMySQL Help
Receive the tools necessary to be the rock star of your field. Our 12-month program teaches you the evolving world of multi-channel marketing as well as the complex issues and opportunities found in the industry.

ASP Free and Iron Speed Designer are giving away $5,500+ in FREE licenses. Iron Speed's RAD CASE toolset can save up to 80% of your coding time. One free license per week, one perpetual license per month!
Download and Activate to enter!

Web development can be a daunting task, even for specialists. There is a lot of information to absorb and a lot of technologies to learn in order to manage a superior website. When trying to learn the ropes, developers need a reliable source to introduce new ideas that can be easily implemented. When working on large projects, even web veterans may run into a technology or an aspect of a technology that they are unfamiliar with.

Learn More!


Download to Enter
| Contest Rules

Tutorials | Forums

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 5th, 2012, 05:21 AM
whispiri whispiri is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2012
Posts: 1 whispiri User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 51 m 54 sec
Reputation Power: 0
MySQL looping issue

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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > MySQL looping issue


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.

© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 2 - Follow our Sitemap