I have the parents/etc working perfectly now, but I'm not super sure where I should be putting that bit of code for the children?
---
OK, so in my view/myadoptsview.php, where I am currently displaying this information, I have this so far for displaying parents and grandparents (please note my set-up for managing pets is modified):
PHP Code:
$mother = $mysidia->db->select("owned_adoptables", array("mother"), "aid = '{$adopt->getAdoptID()}'")->fetchColumn();
if ($mother == NULL) { $motherview = "Unknown"; } else { $motherview = "<a href='../../levelup/click/{$mother}'><img src='http://catisserie.net/levelup/siggy/{$mother}' width='25%'/></a>"; }
$father = $mysidia->db->select("owned_adoptables", array("father"), "aid = '{$adopt->getAdoptID()}'")->fetchColumn();
if ($father == NULL) { $fatherview = "Unknown"; } else { $fatherview = "<a href='../../levelup/click/{$father}'><img src='http://catisserie.net/levelup/siggy/{$father}' width='25%'/></a>"; }
$grandmotherA = $mysidia->db->select("owned_adoptables", array("grandmotherA"), "aid = '{$adopt->getAdoptID()}'")->fetchColumn();
if ($grandmotherA == NULL) { $grandmotherAview = "Unknown"; } else { $grandmotherAview = "<a href='../../levelup/click/{$grandmotherA}'><img src='http://catisserie.net/levelup/siggy/{$grandmotherA}' width='12%' /></a>"; }
$grandmotherB = $mysidia->db->select("owned_adoptables", array("grandmotherB"), "aid = '{$adopt->getAdoptID()}'")->fetchColumn();
if ($grandmotherB == NULL) { $grandmotherBview = "Unknown"; } else { $grandmotherBview = "<a href='../../levelup/click/{$grandmotherB}'><img src='http://catisserie.net/levelup/siggy/{$grandmotherB}' width='12%' /></a>"; }
$grandfatherA = $mysidia->db->select("owned_adoptables", array("grandfatherA"), "aid = '{$adopt->getAdoptID()}'")->fetchColumn();
if ($grandfatherA == NULL) { $grandfatherAview = "Unknown"; } else { $grandfatherAview = "<a href='../../levelup/click/{$grandfatherA}'><img src='http://catisserie.net/levelup/siggy/{$grandfatherA}' width='12%' /></a>"; }
$grandfatherB = $mysidia->db->select("owned_adoptables", array("grandfatherB"), "aid = '{$adopt->getAdoptID()}'")->fetchColumn();
if ($grandfatherB == NULL) { $grandfatherBview = "Unknown"; } else { $grandfatherBview = "<a href='../../levelup/click/{$grandfatherB}'><img src='http://catisserie.net/levelup/siggy/{$grandfatherB}' width='12%'/></a>"; }
And then I display this information like so;
PHP Code:
<center><strong>Family Tree</strong><br>
<table border='0'>
<tr>
<td></td>
<td></td>
<td>{$grandmotherAview}</td>
</tr>
<tr>
<td></td>
<td>{$motherview}</td>
<td>{$grandfatherAview}</td>
</tr>
<tr>
<td>{$name}</td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td>{$fatherview}</td>
<td>{$grandmotherBview}</td>
</tr>
<tr>
<td></td>
<td></td>
<td>{$grandfatherBview}</td>
</tr>
</table>
</center><br>
And as you can see it's working splendidly!