You are here: Re: Smarty and PEAR DB « PHP « IT news, forums, messages
Re: Smarty and PEAR DB

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация