-1

The below code is for a search function, and the query I am getting in $sql is working if I try in MySQL or phpMyAdmin, but $dataProvider->getData(); is empty here, and that too in few cases because in some cases it gives result and in few cases, it doesn't.

$count=new CSqlDataProvider($sql,
    array(
        'pagination'=>FALSE,
        'params'=>$sqlParam
        )
    );

$dataProvider=new CSqlDataProvider($sql,
    array(
        'totalItemCount'=>count($count->getData()),
        'pagination'=>array(
            'pageSize'=>Yii::app()->getModule('search')->searchPageSize,
            ),
        'params'=>$sqlParam
        )
    );
$dataProvider->getData();    
Frits
  • 7,341
  • 10
  • 42
  • 60

1 Answers1

0

Did you see this example?

Comment your 'totalItemCount' parameter and try again.

venoel
  • 463
  • 3
  • 13