Table on several pages

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I am not very experienced in PHP, but would like to make a simple
script that will get ordered data from mySql source and present it in
web browser on several pages. I.e. Having 100 records, I would like to
show only first 20, and have some links: 1 2 3 ... n to next pages
(i.e. clicking on 2 will show records from 20 to 40, etc.). I believe
it is very simple script, so... it is supported by some PHP libraries
or it provides built-in functionality to make such solution easy to
implement? Thank you very much!

regards, Mark

Re: Table on several pages

mark wrote:
Quoted text here. Click to load it

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Re: Table on several pages

What you are looking for is called a "pager"  quick google search for
"php data pager" brought up this tutorial on coding one:

There are pagers in some frameworks like PEAR and Smarty, but I don't
use them so I can't help there.


Re: Table on several pages

Quoted text here. Click to load it

Try google for 'PHP paged data grid'


Re: Table on several pages

Quoted text here. Click to load it

php has no such function. You can just add a query parameter to
represent the page number, and use LIMIT in mysql query to do pages.

Re: Table on several pages

Wow, everyone is sending him to google... nobody has the time to
explain what pagination is all about?

Re: Table on several pages

alienatu wrote:
Quoted text here. Click to load it

The OP: already knows what pagination is all about, he wants to know how
to do it.  Since I presume most posters here have coding jobs that pay
money for their work, why take all the time to write the scripts for him
when he can be given the tools 'google' to LEARN and write them himself.

Most tutorials on the web can be more encompassing by people who can
take the time and effort to write them, then someone who can hack
together a quick answer for him here.

But if you feel up to it, I look forward to seeing YOUR solution for the


Re: Table on several pages

<Tue, 28 Oct 2008 06:29:56 -0700>

Quoted text here. Click to load it

The 1,2,3,etc type of pagnation isnt always the best way to do it .

In the above example i decided that next/previous buttons where better
than scrolling up and down .

The point being .....

The best pagnation method is the one that suits the information being
displayed .

Bruce Lee was once asked what was the best kung fu method was .

He replied with something like 'the one that wins' .

The same could be said about pagnation .

Site Timeline