I have the results from a query and I want to add at this array another one,but it does not work.What is wrong?
The code is bellow
public function getEponumousStatus($param) {
$sql = "SELECT .... ";
$newSQL = "select photo,display_name from profile where pr_id=:user and cp_type=0";
$command = Yii::app()->db->createCommand($sql);
$command->bindParam(":user", $param, PDO::PARAM_STR);
$rows = $command->queryAll();
$command->text = $newSQL;
foreach ($rows as $value) {
$command->bindParam(":user", $value['id'], PDO::PARAM_STR);
$row = $command->queryRow();
if (count($row) > 0) {array_push($value,$row) ;
// $value['photo'] = $row['photo'];
// $value['display_name'] = $row['cp_display_name'];
} else {
// $value['photo'] = null;
// $value['display_name'] = null;
};
}
var_dump($rows);
return $rows;
}
}
[edit]I just make another array and add the 2 arrays to that.Is there another solution?My problem is that the second query maybe not have values.