I have yet to come across a good tutorial that explains how to load records from a database and spit them out using jQuery Ajax and also display pagination navigation.
Example Page
- Apple
- Banana
- Pear
- Grapes
(Pagination Nav) [First Page] [Prev Page] [5] [6] [7] [Next Page] [Last Page]
In my head I think it works like this.
- User loads home page. Home page by default spits out records with at the first offset and with a specified results per page (e.g. LIMIT 0,10)
- Serverside script queries count of records, extrapolates number of pages to navigate by using results per page.
- Serverside script echoes a navigation panel based on current page.
- jQuery listens for click events on navigation panel, uses get to fetch the content and sets html of content container.
I also want the URL of the site to change in case anyone refreshes the page (to obviously display the desired result).
How can this be done?