public function actionIndex()
{
$criteria=new CDbCriteria();
$sql = 'SELECT subject,picture
FROM cases
ORDER BY createtime ASC';
$query = Yii::app()->db->CreateCommand($sql);
$res = $query->query();
/*change to this now: $res = $query->queryAll(); */
$pages=new CPagination($res->rowCount);
/*change to this now: $pages=new CPagination(count($res));*/
$pages->pageSize = 8;
$pages->applyLimit($criteria);
$query = Yii::app()->db->createCommand($sql.' LIMIT :offset,:limit');
$query->bindValue(':offset',$pages->currentPage*$pages->pageSize);
$query->bindValue(':limit', $pages->pageSize);
$this->v['posts'] = $query->queryAll();
$this->v['pages'] = $pages;
$this->title = 'Cases';
$this->render($this->action->id,$this->v);
}
Hello,This is a action in the Controller,It’s Output error Words ‘Cannot execute queries while other unbuffered queries are active’ When run this program in Linux OS,How do i change this code?Please help me!