PHP HTML iterating through result set from mysql

Discussion in 'PHP' started by ianlufc, Jan 12, 2008.

  1. #1
    Hi guys

    i know this is probably basic PHP but im at that level!

    can anyone give me some php and html code that will iterate through results from a mysql table using html NEXT, Previous Buttons.

    iv been trying it but when i press a next button the page seems to refresh to the original and showing up the first entry.

    Any Help appreciated

    Cheers Ian
     
    ianlufc, Jan 12, 2008 IP
  2. babyboy808

    babyboy808 Well-Known Member

    Messages:
    491
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    125
    #2
    You mean pagination?
     
    babyboy808, Jan 12, 2008 IP
  3. ianlufc

    ianlufc Peon

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    any code to help me out on pagination mate?
     
    ianlufc, Jan 12, 2008 IP
  4. MMJ

    MMJ Guest

    Messages:
    460
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You can't iterate through a dbase like that in real-time.

    Unless you hack around it with AJAX.
     
    MMJ, Jan 12, 2008 IP
  5. ianlufc

    ianlufc Peon

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    thats what i was afraid off!!!!!!
     
    ianlufc, Jan 12, 2008 IP
  6. highborn

    highborn Active Member

    Messages:
    184
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    55
    #6
    here is a tutorial for paging sql results.

    hxxp://www.php-mysql-tutorial.com/php-mysql-paging.php
     
    highborn, Jan 12, 2008 IP
  7. ianlufc

    ianlufc Peon

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    cheers highborn il have a look
     
    ianlufc, Jan 12, 2008 IP
  8. shedboy

    shedboy Peon

    Messages:
    63
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #8
    You might want to check out the pager package from http://pear.php.net/package/Pager

    There is also a link in there to some examples, I have used this package before on a site of mine and its very good
     
    shedboy, Jan 13, 2008 IP