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   1575 Views

Avatar
Sec

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?

Thanks!

Avatar
Sec

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'".

Avatar
dio5

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