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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.