I´m using this script to show pedigrees, works fine.
Now i want to show a virtual pedigree (for testmating or puppys).
For puppys i add a new table in database with id, father_id, mother_id. All other (living) dogs are in table dog (again with father and mother id). So this is working for dogs who are already in table dog:
$sql = "SELECT a.father_id, a.mother_id, s.dogname, d.dogname FROM dog a INNER JOIN dog s ON a.father_id = s.id INNER JOIN dog d ON a.mother_id = d.id WHERE a.id = '$dogid' ";
But my puppy isn´t in table dog... Is there a way to say get father and mother from puppy and then get all other generation from dog?