We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20765
    • 90 Posts
    myfriendscallmebill Reply #1, 19 years, 6 months ago
    the parameter &limit is described as "Number of documents to retrieve from database, same as MySQL LIMIT"

    The parameter &total is described as "Number of documents to retrieve"

    What’s the difference?
      • 18397
      • 3,250 Posts
      Exactly as it says. &limit is a MySQL limit on the result set. &total is a php based limit. You would use &limit when dealing with non-prefetched results or using a custom where statement. Otherwise, use &total.
        • 20765
        • 90 Posts
        myfriendscallmebill Reply #3, 19 years, 6 months ago
        Quote from: Mark at Mar 27, 2007, 04:51 PM

        Exactly as it says. &limit is a MySQL limit on the result set. &total is a php based limit. You would use &limit when dealing with non-prefetched results or using a custom where statement. Otherwise, use &total.
        I’m sorry, I don’t know what a MySQL limit is. But if I understand your answer correctly:
        (1) Both parameters restrict the number of documents in the result set.
        (2) &limit makes MySQL enforce the restriction.
        (3) &total makes PHP code enforce the restriction.
        (4) And I should use &total unless "dealing with non-prefetched results or using a custom WHERE statement".

        Is that correct?
          • 18397
          • 3,250 Posts
          1. Google MySQL Limit to find out more. Its very useful when dealing with large datasets (say greater than 500 documents)
          2. Thats correct. However, its important to point out the PHP restrictions still apply, this just means the dataset is cut off at that number BEFORE it is parsed by the filter.
          3. Correct.
          4. Correct.