We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28120
    • 380 Posts
    I might be misunderstanding &offset

    I thought if I had the parameter &offset=`2` then where a result might normally return 10 records instead it would return 8 records starting from record 3

    However with offset defined it doesn’t make any difference to my results?

    Thanks

    Mark
      • 22303 MODX Staff
      • 10,725 Posts
      Quote from: sparkyhd at May 11, 2011, 05:21 AM

      I might be misunderstanding &offset

      I thought if I had the parameter &offset=`2` then where a result might normally return 10 records instead it would return 8 records starting from record 3
      You are misunderstanding. &offset simply defines how many rows to skip in the result set. The &limit parameter defines how many records are returned.
        • 28120
        • 380 Posts
        Thanks

        Actually I realize the problem is I had &limit=`0` which stopped &offset working.

        I wanted to show everything on file excluding the first 8 so I had &limit=`0` &offset=`8` but this returned everything.

        By changing it to &limit=`9999` &offset=`8` (where 9999 is way bigger than the highest number of records) I got what I wanted.