This is called pagination. You can find a lot of previous posts on this site if you do a search. You can find a lot of references on Google as well.
chrishea
Nearly a Posting Virtuoso
1,428 posts since Sep 2008
Reputation Points: 210
Solved Threads: 230
@davidborg - won't get far without the paginated class
diafol
Rhod Gilbert Fan (ardav)
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
When you mention disabling? What do you mean?
I'm assuming that you have a mysql table with 100's of rows of data.
You then want to 'chunk up' this data into displaying say 20 rows only.
You want a navigation system (like Google maybe) showing the next and previous 'chunks' of data. Is that right?
You can find a ready-written class for this - loads out there, or you can write your own.
The basics:
1. get the total number of rows in the DB that satisfy your general query (e.g. 497)
2. stipulate how many rows you want to display in your html table (e.g. 40)
3. calculate the number of 'pages' or 'chunks' of data that you need in total (e.g. 12)
4. see if a page number has be passed in the url (from a link), e.g. ...?page=4
5. if so, check the page is valid (numeric, not greater than total no. [12] and not less than [1]). Force the page number to 1 or 12 if it is invalid, depending on the actual value.
6. use the values so far to create a LIMIT clause (see mysql manual) and run the query
7. display the data from the query into html
8. display navigation links
It's not that difficult.
//BTW if you want to output this data in PDF, you may find this site interesting: http://www.tcpdf.org
There are loads of PDF classes out there, some very much better than each other. The one I've included seems to be the easiest and the best for me from a unicode point of view. There are loads of included examples in the download.
diafol
Rhod Gilbert Fan (ardav)
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080