Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Jan 2012
    Location
    localhost
    Posts
    14
    Thanks
    3
    Thanked 0 Times in 0 Posts

    "Show more" button

    Hi!

    I'm newbie with MySQL... and have a little problem. Hope someone know how to solve this.

    I have one table in database... and I use this:
    INSERT INTO table VALUES ( "Looong text", "1" ), ( "Loooong text", "2" ) , ( "Loooong text", "3" ), ( "Loooong text", "3" )

    And page is loaded very very slowly beucase it's too much text there. I thought if it's possible to show only 1-2 rows and then to add a "show more" button and when it's pressed to show 3-4 rows. Hope someone can understand, bad english here.

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,853
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Have a look at some results under http://www.google.com/search?q=php+mysql+pagination
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • Users who have thanked abduraooft for this post:

    cat250 (01-18-2012)

  • #3
    New Coder
    Join Date
    Jan 2012
    Location
    localhost
    Posts
    14
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Thanks. Use this now: http://www.phpsimplicity.com/tips.php?id=1

    Code:
    echo '<a href="'.$_SERVER['PHP_SELF'].'?startrow='.($startrow+2).'">Next</a>';
    $prev = $startrow - 2;
    if ($prev >= 0)
    echo '<a href="'.$_SERVER['PHP_SELF'].'?startrow='.$prev.'">Previous</a>';
    But "Next" and "Previous" is show twice, what do? Thanks.

  • #4
    New Coder
    Join Date
    Jan 2012
    Location
    localhost
    Posts
    14
    Thanks
    3
    Thanked 0 Times in 0 Posts
    nobody?

  • #5
    New Coder
    Join Date
    Jan 2012
    Location
    localhost
    Posts
    14
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Fixed.
    Last edited by cat250; 01-21-2012 at 12:03 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •