Jump to:

23007 Posts in 11866 Topics by 2828 members

General Questions

SilverStripe Forums » General Questions » Offset in query

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

Page: 1
Go to End
Author Topic: 1452 Views
  • Sec
    Avatar
    Community Member
    13 Posts

    Offset in query Link to this post

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

    Thanks!

  • Sec
    Avatar
    Community Member
    13 Posts

    Re: Offset in query Link to this post

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

  • dio5
    Avatar
    Community Member
    501 Posts

    Re: Offset in query Link to this post

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

    1452 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.