Is there any way to limit CSqlDataProvider? When I can set totalItemCount to 3, for example, the result is not taken into account.
$count=Yii::app()->db->createCommand('SELECT COUNT(*) FROM tbl_user')->queryScalar();
$sql='SELECT * FROM tbl_user';
$dataProvider=new CSqlDataProvider($sql, array(
'totalItemCount'=>3,
'pagination'=>array(
'pageSize'=>10,
),
));
When I try to limit the LIMIT 3 request and comment on totalItemCount, I get:
CDbCommand failed to execute the SQL statement: SQLSTATE[42000]: Syntax error or access violation: ... LIMIT 3 LIMIT 10
It seems like everything I do sql is added using LIMIT 10.
source
share