SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Dec 2005
    0 Post(s)
    0 Thread(s)

    Show records from record 3 and then on?!?

    I'm trying to figure out if its possible to skip the irst 2 records and then show all after that?

    I'm trying to get comments to a blog out of an table but the 2 latest is allready shown so I want to make a button to show the rest... Can this be done?

    The sql that get the 2 latest comment:
    PHP Code:
    SELECT FROM ".$prefix."_clubnews WHERE comment AND ori_newsid=$newsid ORDER BY newsid ASC LIMIT 2 
    How to make a query to gte only the rets without the 2?

    Thanks in advance ;-)

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    163 Post(s)
    4 Thread(s)
    use LIMIT.
    I quote from the mysql manual
    To retrieve all rows from a certain offset up to the end of the result set, you can use some large number for the second parameter. This statement retrieves all rows from the 96th row to the last:

    SELECT * FROM tbl LIMIT 95,18446744073709551615


Posting Permissions

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