Sorry if this question is not related to Phalcon it self, but i am having a problem fetching the higest ID when using offset.
Lets say i have the data:
1
2
3
4
5
6
7
8
9
Then i need to fetch the data ordered like this:
Page 1:
7
8
9
Page 2:
4
5
6
Page 3:
1
2
3
The problem is that when i fetch the data, when using offset it get's the first 3 rows and lot 3 last rows. Changing DESC dosent help.
My model looks like this:
$conversation = Self::find(array(
'conditions' => '(id = ?1 OR parent_id = ?1) AND user_id = ?2',
'bind' => array(1 => $comment_id, 2 => $user_id),
'limit' => 3,
'offset' => $offset,
'order' => 'id DESC'
));
return $conversation;
Hope you can help me solve my problem!