in the
returned results of the query. Thanks for the help!
mack
- Original Message -
From: Norland, Martin [EMAIL PROTECTED]
Date: Wednesday, November 24, 2004 3:55 pm
Subject: RE: [PHP-DB] how to implement pages of results
Correct - LIMIT 30,2 would show 2 records starting
Basic example: (handwritten in email client, syntax errors may exist)
if (!isset($pagenum) || $pagenum 0) { $pagenum = 0; }
$range = 30;
$start = $range*$pagenum;
$end = $start + $range;
$limit = limit $start, $end;
$query = select * from $table where host='$somename'$limit;
Then just pass the
Off the top of my head, doesn't LIMIT accept two paramters?
Can't you do:
LIMIT 30,2
That'd give you page 2 of a 30+ record result set, right?
Using that, you can pass a page # when you click next page so previous
page ends up being current page - 1 (and if that is less than 1, then
it equals
Correct - LIMIT 30,2 would show 2 records starting with the thirtieth.
thirty-first.
Sheesh, I should get outta here too - ^airhead^
- Martin Norland, Database / Web Developer, International Outreach x3257
The opinion(s) contained within this email do not necessarily represent
those of St.