Page 1 of 1

Limit the number of results, and make into new pages

Posted: Mon Jul 19, 2010 7:18 pm
by tom8521
Sometimes the number of results you can retrieve from a database are huge, which is why it is important to place the first 10 results and links to further results.

My website deals with retrieving properties for sale, so I need to only retrieve the first 10 properties, then link to the next page of 10 and so on.

How do I do this?

Re: Limit the number of results, and make into new pages

Posted: Mon Jul 19, 2010 7:57 pm
by buckit
what you are looking for is Pagination.


I have written one myself but it took me a while to work it out and I still have a flaw with it (when I hit a certain number of pages, the last page has no results.. so its a calculation problem)

anyway... here is a good tutorial to get you started... it will help you a lot to understand how it works rather than just throwing code at you.

http://www.phpfreaks.com/tutorial/basic-pagination

-Jeff