On Fri, 13 Feb 2004, Karen Resplendo wrote:
> I guess the time has come that my boss wants "Next", "Previous", "First",
> "Last" paging for our data displays of large recordsets or datasets.
Advertising
First, do a query to find out how many rows.
select count(*) from table where (your where clauses for the query);
That's your # of records.
Then do:
select count(*) from table where (your clauses) limit
($pagenum*$itemlimit)-$itemlimit), $itemlimit;
so if your $itemlimit = 10 items per page, and you are on page 3,
it would be ... limit 20, 10
page #1, limit 0,10 etc
> Also, how to deal with printing? I would assume that the ideal page size
> is not the ideal printed page size. oi vay!
In IE 6, this works:
<br style='page-break-after:always;'>
Even if your text follows, IE will print a page break. Haven't researched
how to do it in Mozilla or Netscape.
Beckman
---------------------------------------------------------------------------
Peter Beckman Internet Guy
[EMAIL PROTECTED] http://www.purplecow.com/
---------------------------------------------------------------------------
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php