View Single Post
  #1  
Old 04-30-2012, 05:05 AM
SilverDragonTears's Avatar
SilverDragonTears SilverDragonTears is offline
I am your Nemesis.
 
Join Date: Jun 2011
Posts: 1,113
Gender: Female
Credits: 84,617
SilverDragonTears is on a distinguished road
Default More fetching from tables help

This snippet of code is suppose to get the names of the parents and show them. As it is now... it shows nothing. I can get it to show the id of the parents, but I'd like it to show their names.

Code:
$result = $adopts->select("owned_adoptables", array(), "aid='{$id}'");
	while ($row = $result->fetchObject()) {
$father=$row->father;
$mother=$row->mother;

$getFather = $adopts->select("owned_adoptables", array(), "aid='{$father}'");
                         
$getMother = $adopts->select("owned_adoptables", array(), "aid='{$mother}'");
$nFather = $row->getFather;
$nFather = $nFather['name'];
$nMother = $row->getMother;
$nMother = $nMother['name'];
if(empty($row->father)) {
    $article_content .= '<b>Caught On:';
} else {
    $article_content .= '<b>Laid On:';
     
}

$article_content .= "{$row->date}<br>";



if($father == '' && $nMother == '') {
    $article_content .= '';
} else {
    $article_content .= 'Father: ' . $nFather . '<br> 
                  Mother: ' . $nMother . '<br>';
    
}

}
__________________

Check out SilvaTales
Reply With Quote