Guess I understand how family tree works now. The $mother or $father is the $parentid I was referring to. You can ignore the first step and modify the second step as:
PHP Code:
if(isset($mother)){
$query = "SELECT * FROM {$prefix}owned_adoptables,
{$prefix}adoptables WHERE {$prefix}owned_adoptables.mother = '{$mother}'
AND {$prefix}adoptables.type = {$prefix}owned_adoptables.type
ORDER BY {$prefix}owned_adoptables.aid";
$result = runquery($query);
}
if(isset($father)){
$query = "SELECT * FROM {$prefix}owned_adoptables,
{$prefix}adoptables WHERE {$prefix}owned_adoptables.father = '{$father}'
AND {$prefix}adoptables.type = {$prefix}owned_adoptables.type
ORDER BY {$prefix}owned_adoptables.aid";
$result = runquery($query);
}
It seems that you may need to either write a new script file or create a subpage for familytree.php to display an adoptables' children.