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.

We've moved the forum!

Please use for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

Offset in query

Go to End

3 Posts   3292 Views


Community Member, 13 Posts

26 January 2009 at 9:41pm

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



Community Member, 13 Posts

26 January 2009 at 9:56pm

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


Community Member, 501 Posts

26 January 2009 at 11:03pm

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");