View Full Version : Slow Pagination (potentially) - Is there a better way?

03-19-2009, 06:29 PM
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:


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


~ Mo