Alan Halls ([EMAIL PROTECTED]) writes:

> Here is what our company uses to do the page division on adoptablekids.com I
> have used it for a few other applications with minimum changes
> This code would give you five per page.
> 
> 
>       <sql detail=rhs pgsize="5">
>               select * from profile order by id DESC
>       </sql>
> 
> <perl>
> 
>       return if ({sys:num_pages} <= 1);>      my $pg;
>       if ({sys:prevpg_link})
>       {
>               wgprint "";
>       }
>       for ($pg = 1; $pg <= {sys:num_pages}; $pg++)>   {
>               if ($pg == {sys:page_num})
>               {
>                       print "$pg\n";
>               }

Inefficient.  Better to use LIMIT.

select * from blah limit start,recordcount
--
Ed Carp, N7EKG          [EMAIL PROTECTED]           940/367-2744 cell phone
http://www.pobox.com/~erc               [EMAIL PROTECTED] - text pager

I sometimes wonder if the American people deserve to be free - they seem
so unwilling to fight to preserve the few freedoms they have left.

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to