Reply to Large query results - Limiting the data, but still knowing the full row count - How?

Your name:

Reply:


Posted by cluthz on 06/13/07 09:00

Hi there,

I have query which returns to many results to handle (therefore to be
displayed screen at one time and to be transferred from the server).

I therefore want to create a search results screen which displays a limited
subset of query results and the user of the application can control which
subset of results are displayed (e.g. say there are 10000 matching results,
the user can see results 1-500, and move on in batches of 500).

The only thing is, to get the amount of rows I still have to run a very
similar (and therefore big) MySQL query as if I was getting all 10000
results, just to find out how many results there actually are.

So am I right in thinking this is the way to go about it. Therefore I run
the query once but only ask for a count of results to be returned. This
gives me the total amount of matches.
Then I run the query again, this time returning all the fields information,
but this time I use LIMIT to restrict the actual results.

I hope this question makes sense and thanks in advance for any input.

[Back to original 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

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