Yii Framework Forum: Query-> limit problem - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Query-> limit problem Rate Topic: -----

#1 User is offline   Kazel 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 02-March 10

Posted 14 May 2010 - 02:34 AM

I'd like to run SQL query "select * from member limit 20,5"
How to run it in Yii???

I've tried this:
$cri=new CDbCriteria;
$cri->limit=20,5;
$query=member::model()->findall($cri);


But it returned with error code...
Need help, please...
0

#2 User is offline   Maurizio Domba Cerin 

  • Yii - Yesss It Is !!!
  • Yii
  • Group: Yii Dev Team
  • Posts: 4,353
  • Joined: 12-October 09
  • Location:Croatia

Posted 14 May 2010 - 02:43 AM

Haven't used yet, but try with:

$cri->offset=20;
$cri->limit=5;


offest detail - http://www.yiiframew...a#offset-detail
limit detail - http://www.yiiframew...ia#limit-detail
Find more about me.... btw. Do you know your WAN IP?
0

#3 User is offline   Kazel 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 02-March 10

Posted 14 May 2010 - 02:57 AM

It worked... :lol:
Thanks, mdomba... ;D
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users