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?
Limit the number of results, and make into new pages
Moderator: General Moderators
Re: Limit the number of results, and make into new pages
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
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