pagination with php with a possible infinite limit
-
I know how to create pagination with php if I have 25 results with 5 results each page, but what about if the limit number can change in the hundreds everyday? How can I write something where the php itself will create more pages if the row count itself changes?
-
Answer:
Take a look at: http://www.phpclasses.org/package/1239-PHP-Spliting-database-query-result-sets-between-pages-.html It should solve your problem... Also you can search for other pagination classes to check the source code and/or use as it is!
carlgcode at Stack Overflow Visit the source
Other answers
usually pagination is made in two steps: query to count the number of records unsig the prevoius query, create the query using LIMIT to retrieve the current page So i don't see the problem o_O, if tomorrow the number of elements change then the first query would return a different result.. and you wont have problems with the pagination Later, if you want to improve performance you could set a cache system for the count query. Hope this helps
pleasedontbelong
Related Q & A:
- Is there a maximal finite depth infinite index irreducible subfactor?Best solution by Mathoverflow
- Is there a limit to how much concise information a human can learn adequately?Best solution by Yahoo! Answers
- How to pass a variable from php to a modal?Best solution by Stack Overflow
- Is there a limit on the size of a new file or a text file?Best solution by Stack Overflow
- Is there a limit on the number of members a yahoo group can have?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.