The code below returns all records from a database table.
$criteria = array(
'pagination' => array('pageSize' => 20),
'sort' => array(
'defaultOrder' => 'id DESC',
),
);
$dataProvider = new CActiveDataProvider('Step1', $criteria);
I need to modify it so it will only return records where a column matches a specific value. For example, only show records where "microsoft.com" is in the "site" column of the database.
$criteria = array(
':site' => Yii::app()->params['src'],
'pagination' => array('pageSize' => 20),
'sort' => array(
'defaultOrder' => 'id DESC',
),
);
$dataProvider = new CActiveDataProvider('Step1', $criteria);
Can someone tell me what I’m doing wrong?