Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Offset in query


Reply

3 Posts   1549 Views

Avatar
Sec

26 January 2009 at 9:41pm Community Member, 13 Posts

Is it possible to set the offset of a query? Do I have to use regular mysql queries to do this?

Thanks!

Avatar
Sec

26 January 2009 at 9:56pm Community Member, 13 Posts

Have not tried it yet, but I guess it belongs in the "limit" parameter place, e.g. "'LIMIT'='$count' 'OFFSET'='$offset'".

Avatar
dio5

26 January 2009 at 11:03pm Community Member, 501 Posts

yes, for a limit it would be something like:

return DataObject::get("MyPage", "", "Date DESC", "", "$limit");

or with an offset and a limit:

return DataObject::get("MyPage", "", "Date DESC", "", "$offset, $limit");