Flat File Database Demo 6
7th February 2012 · Last updated: 9th May 2012
Inspired by a request from user Dan Pena, this demo splits the results of a flat file database search into separate pages. Instead of listing everything in one long list, the results are shown page by page. There are buttons to move to each new page.
You can define the number of results shown on each page via the variable $limit at the start of the code. I've set it to 10 as that looks nice. So if there are 15 results in a search, only the first 10 are shown. A button appears to see the next page, which has the remaining 5 results on. Got that? Good! Try it and you'll see what I mean:
So how does it work? Well firstly, some things to know:
So there aren't really any pages as such - it's all done with one page. I realise this creates accessibility concerns (as you can't bookmark the pages). I might redo the demo later to work with physical pages instead.