Re: Web page paginator that doesn't rely on the LIMIT clause

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



1. What prevents you from implementing the conditions directly in SQL? You
can achieve a lot with CASE and IF.
2. For your paging needs, you may benefit from investigating the PEAR
HTML_Pager class.

Ignatius
_________________________
----- Original Message -----
From: "Ross Honniball" <ross@xxxxxxxxxxxxxxxxxxx>
To: "php DB" <php-db@xxxxxxxxxxxxx>
Sent: Tuesday, August 03, 2004 12:52 PM
Subject:  Web page paginator that doesn't rely on the LIMIT clause


> Hi all,
>
> I use the LIMIT statement to control paging of data, which works really
well.
>
> I now have a situation where I need to use some logic in addition to the
> query that will result in NOT ALL records being spat out. ie.
>
> select * from x where y;
> foreach result
>      if (some condition)
>          output;
>      endif
> endfor
>
> So problem is I can't say LIMIT 20,20 on the query as logic may result in
> less than 20 records being spat out to screen.
>
> I was planning on coding up a solution so that i just keep a count myself
> of how many records I have output myself and break at appropriate paging
> points, but I am probably re-inventing the wheel.
>
> Anyone know of any good classes they are using that do this sort of thing
> already?
> .
> . Ross Honniball. JCU Bookshop Cairns, Qld, Australia.
> .
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux