Say I have a complex sql query for multiple words and across multiple fields. Imagine I have 100 results that match and I wish to display only 25 per page. Would the following be the best approach?
Perform search
Count records
Number of pages = count/25
Extract first 25 results
Now I am trying to get my head round this. Surely it is not the best idea to have the whole result set in an array. Would it be better to use LIMITs to only get the ones the user is after from the DB as and when required. I know this means more db call but that is the theory side I am after.
Any advice or pointers appreciated.
Cheers
<A HREF"query script?limit=$ul">More Results</A>
goes to
$llimit = $ul;
$ulimit = $llimit+25;
$sql = "query string LIMIT $llimit, $ulimit"
Oversimplified here of course, but you get the idea. It worked for me.
WBF