YII的 queryAll() 返回的数组
Array
(
[0] => Array
(
[max(p_price)] => 68.00
[min(p_price)] => 2.00
[avg(p_price)] => 21.065231
)
)
把这个数组传递到页面上,值怎么取出来呢?
if($cat_value)
{
$connection = Yii::app()->db_pre;
$sql = "SELECT max(p_price) ,min(p_price),avg(p_price) FROM pre_item where p_cat_name='{$cat_value}'";
$command = $connection->createCommand($sql);
$price = $command->queryAll();
}
print_r($price);
嗯, 谢谢啦