By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,664 Members | 1,656 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,664 IT Pros & Developers. It's quick & easy.

Table on several pages

P: n/a
Hello,

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
Oct 25 '08 #1
Share this Question
Share on Google+
7 Replies


P: n/a
mark wrote:
Hello,

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
http://www.google.com/search?q=php+pagination

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Oct 25 '08 #2

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

http://www.php-mysql-tutorial.com/php-mysql-paging.php

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

Larry
Oct 26 '08 #3

P: n/a
On 25 Oct, 13:43, mark <mkazmier...@gmail.comwrote:
Hello,

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
Try google for 'PHP paged data grid'

C.
Oct 26 '08 #4

P: n/a
AqD
On Oct 25, 9:43 pm, mark <mkazmier...@gmail.comwrote:
Hello,

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
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.
Oct 28 '08 #5

P: n/a
Wow, everyone is sending him to google... nobody has the time to
explain what pagination is all about?
Oct 28 '08 #6

P: n/a
alienatu wrote:
Wow, everyone is sending him to google... nobody has the time to
explain what pagination is all about?
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
OP:.
Scotty
Oct 28 '08 #7

P: n/a
<comp.lang.php>
<FutureShock>
<Tue, 28 Oct 2008 06:29:56 -0700>
<xr*****************@flpi143.ffdc.sbc.com>
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.
http://www.cannabiswindow.co.uk/gues..._guestbook.php

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 .
Oct 28 '08 #8

This discussion thread is closed

Replies have been disabled for this discussion.