Using pagging techniques - I
2 August 2008When displaying long lists on the web, we use pagging techniques. In this post, I will show how to do that.
Normally we display 10 or 15 results at a time and the user can scroll through the list. If list is a long one, then it does not make an sense to loat it completely. Loading the complete list in session and then loop through the results is not a nice approach. An approach can be to use pagination tags whihc means fetching and displaying the results one page at a time. Pagination tag removes from the developer the burden of coding for navigation and anchors.
Let me present an example: We do some search and the result count is over 1000. But from our middle tier, we don’t return 1,000 results; instead we limit our query to return 10 or 15 results.
In MySQL, we can do that like this:
SELECT * FROM TABLE WHERE {CONDITION} LIMIT 0, 10.
continued …
Related Posts:
Top Of Page | Trackback
If you found this page useful, consider linking to it. Simply copy and paste the code below into your web site.
It will look like this: Using pagging techniques - I