1
$dataProvider=$model->search();
$dataProvider->criteria->addcondition('company_code= :id')->params=array(':id' => $company);
$this->widget('zii.widgets.grid.CGridView', array(
'id'=>'tblapptcodegrid',
'dataProvider'=>$dataProvider,
'filter'=>$model,
數據顯示正確,但是當我嘗試在過濾器中搜索;它帶有錯誤無效的參數編號:綁定變量的數量不匹配令牌的數量
CDbCommand failed to execute the SQL statement: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens. The SQL statement executed was: SELECT COUNT(*) FROM `tblapptcode` `t` WHERE (appt_code LIKE :ycp0) AND (company_code= :id) (C:\wamp\www\yii\framework\db\CDbCommand.php:543)
任何人都可以解釋爲什麼嗎?
能否請您給一個理由,爲什麼這個工程,而不是一有問題.. –