Table on several pages

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mark

    Table on several pages

    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
  • Jerry Stuckle

    #2
    Re: Table on several pages

    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
    >


    --
    =============== ===
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    jstucklex@attgl obal.net
    =============== ===

    Comment

    • larry@portcommodore.com

      #3
      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.

      Larry

      Comment

      • C. (http://symcbean.blogspot.com/)

        #4
        Re: Table on several pages

        On 25 Oct, 13:43, mark <mkazmier...@gm ail.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.

        Comment

        • AqD

          #5
          Re: Table on several pages

          On Oct 25, 9:43 pm, mark <mkazmier...@gm ail.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.

          Comment

          • alienatu

            #6
            Re: Table on several pages

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

            Comment

            • FutureShock

              #7
              Re: Table on several pages

              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

              Comment

              • Krustov

                #8
                Re: Table on several pages

                <comp.lang.ph p>
                <FutureShock>
                <Tue, 28 Oct 2008 06:29:56 -0700>
                <xrENk.3441$Ei5 .1810@flpi143.f fdc.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.
                >


                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 .

                Comment

                Working...