【发布时间】:2013-03-18 07:04:45
【问题描述】:
我尝试以下查询,它会生成一个数组,
$user = Yii::app()->reg->createCommand()
->select('studentID')
->from('Students')
->queryAll();
但是,当我尝试在 CGridview 中获取查询的值时,我得到了错误,
Property "CDbCommand.0" is not defined.
这里是gridview的代码,
$this->widget('zii.widgets.grid.CGridView', array(
'id'=>'students-grid',
'dataProvider'=> new CSqlDataProvider($user),
));
【问题讨论】: