I have the following code which retrieves player data for a record in the draw table. Having trouble retrieving the players name from a mysql view. I also get the same error if i get the Compteamperson table and try to get the name from the related table.
$compres = Compresults::model()->findAll('drawid='.$id);
$gbtype = '';
foreach($compres as $row)
{
$pmodel = VwCompteamperson::model()->find('id='.$row->playerid);
d2l($pmodel);
print $pmodel->fullname; <<< ERROR HERE
}
The line "d2l($pmodel);" displays the following structure. I use this function to verify data. it seems fine
VwCompteamperson Object
(
[_new:CActiveRecord:private] =>
[_attributes:CActiveRecord:private] => Array
(
[id] => 1
[fullname] => John Smith
[comppersonid] => 1
[personid] => 1
[compteamid] => 9
)
[_related:CActiveRecord:private] => Array
(
)
[_c:CActiveRecord:private] =>
[_pk:CActiveRecord:private] =>
[_alias:CActiveRecord:private] => t
[_errors:CModel:private] => Array
(
)
[_validators:CModel:private] =>
[_scenario:CModel:private] => update
[_e:CComponent:private] =>
[_m:CComponent:private] =>
)
Im just not getting why $pmodel->fullname throws an error. I know i will probably kick myself as this seems pretty simple.
Any help would be appreciated.