Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    Regular Coder mOrloff's Avatar
    Join Date
    Nov 2008
    The Great Pacific NW, USA
    Thanked 6 Times in 6 Posts

    Slow Pagination (potentially) - Is there a better way?

    I still count myself as a newbie, so my approach (and code) are on the simple side.
    Now, I'm a big fan of "Why think zebra when donkey will do", so simple suits me, but not at the expense of performance.

    Right now, I am running my query (using my custom qry func), generating my pagination vars from those results, then re-running the query using the pagination vars.

    Is there a better way of doing this (like maybe not running the qry twice)?

    Here's a snippet of my code:
    PHP Code:

    $rows mysql_num_rows($dataset);
    $limit=($pagenum 1)*pageRows.",".pageRows;

    ~ Mo
    Last edited by mOrloff; 03-19-2009 at 06:49 PM.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts