|
Posted by Lester Caine on 04/12/05 09:37
Matthew Weier O'Phinney wrote:
>>As you can see I need the COUNT value but I not know how get it from =
>>query using PEAR. Some body can help me?
>
> You'll need to do two different queries, one that counts the number of
> total results for the criteria, and one that pulls the set with a LIMIT
> statement.
Of cause the way to get round the performance hit is to keep some of the
key counts actually in the database, populated by triggers. But that
depends on which database engine you are using ;)
In many cases you will get away with a 'lots' for large count, but it is
difficult to know if the count is going to be 10's and you only display
10 at a time, or 1000's and you need to indicate that they will have a
lot of pages unless they tighten the 'filter'. In my case I run the
count as soon as a filter is applied, but keep the table totals in the
database - along with a few useful other totals.
--
Lester Caine
-----------------------------
L.S.Caine Electronic Services
[Back to original message]
|