I have the following criteria in my controller.
$criteria = new CDbCriteria;
$criteria->select = 't.*,b.*,c.*';
$criteria->join = "INNER JOIN tbl_patient_chair b ON b.patient = '0005'
INNER JOIN tbl_chair c ON b.chair = c.Serial_No";
$criteria->condition = "t.client_id = '0005'";
$model = Patient::model()->findAll($criteria);
$this->render('view', array(
'model' => $model
));
Then in my view I am trying to retrieve all the selected data by doing:
foreach ($model as $models)
print_r($model);
But in the result I can see that there is no data from second and third table. The data of the first table is successfully retrieved however I cannot display the other table's data.
Can anyone tell me what I am doing wrong?