Reputation: 43949
I want to fetch intermediate rows from by database.
Like for last 10 rows i will use limit :
return Doctrine_Query::create()
->select('v.*')
->from('Video v')
->where("v.community_id='$community_id' AND v.user_id='$user_id' AND v.published='$published'")
->orderBy('v.id DESC')
->limit(10)
->execute();
but what if i want 110-120 rows?Can anybody tell me about that? how to write this kind of query in doctrine
Upvotes: 0
Views: 294
Reputation: 29304
You could use a Doctrine_Pager
$page = 10;
$limit = 10;
$query = Doctrine_Query::create()
->select('t.*')
->from('SomeTable t')
$pager = new Doctrine_Pager(
$query,
$page,
$limit
);
$rows = $pager->execute();
Upvotes: 3