rajesh
rajesh

Reputation: 81

Limit sql in Cakephp find function

How can I use limit in sql in cakephp...I mean follwoing is the sql...

select * from emp limit 3,4

How can use above limit [3,4] in find function ...

Upvotes: 8

Views: 14124

Answers (2)

pleasedontbelong
pleasedontbelong

Reputation: 20102

I haven't tested it, but it should be something like this in the controller:

$this->Emp->find('all',array('limit'=>'3,4'));

Hope this helps

Upvotes: 4

hasentopf
hasentopf

Reputation: 757

Better way: $this->Emp->find('all', array('limit'=>4, 'offset'=>3);

Upvotes: 22

Related Questions