Hey guys and gals,

I am getting a property of non object and i can not figure out why.

Here is the function that does not seem to be working
PHP Code:
public function getHenCount(){
        
$db = new dboptions();
        
$record $db->rawSelect("SELECT count(*) FROM `poultryinfo` AS total_hens WHERE `sex` = 'hen'");
        return 
$record->fetchAll(PDO::FETCH_OBJ);
    } 
but this one does, and i have tested out the above sql query so i know it's not that. So than it must be how i define the accesor
PHP Code:
    public function selectAllHens(){
        
$db = new dboptions();
        
$record $db->rawSelect("SELECT * FROM poultryinfo WHERE `sex` = 'hen'");
        return 
$record->fetchAll(PDO::FETCH_OBJ);
    } 
and here is how i do that

PHP Code:
$henCount $eggs->getHenCount(); // Get total number of hens
            
$records $eggs->selectAllHens();
            include_once(
'views/eggs_multiAdd.php'); 
PHP Code:
$records $eggs->selectAllHens() 
works fine and the information is displayed in the view file just fine, but when i call
PHP Code:
$henCount->total_hens 
in the view file i get Trying to get property of non-object in eggs_multiAdd.php on line 33 and that is just
PHP Code:
<?php echo $henCount->total_hens;?>
so i am not sure what's going on? Any insight?

Thanks in advance!
-Colin