I’m wondering how can I find these records using the CActiveRecord / CDbCriteria in Yii:
[table]
id | value
---------------
1 | horses
2 | snakes
3 | panteras
4 | commandos
As I said, I want only the three first witch I will specify in the right order: 1, 2 and 3.
How is this possible to achieve in Yii?
yourmodel()::model()->findAll(array(
‘criteria’ => id <= 4)
);
if the ids will be non consecutive, use addInCondition to the cdbcriteria object.