SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: Strange LIMIT problem?

  1. #1
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,566
    Mentioned
    81 Post(s)
    Tagged
    3 Thread(s)

    Strange LIMIT problem?

    Hi folks,
    Just a quick question, why does this query...
    PHP Code:
    $select mysql_query("select * from vse_reservation LIMIT 30,40") or die(mysql_error()); 
    return 40 rows? I always understood that the LIMIT command used as above should bring out lines 30 - 40.

    Slightly puzzled?

    SpikeZ
    Mike Swiffin - Community Team Leader

    Only a woman can read between the lines of a one word answer.....
    I started out with nothing... and still got most of it left!

  2. #2
    SQL Consultant silver trophybronze trophy
    SitePoint Award Recipient r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    38,513
    Mentioned
    35 Post(s)
    Tagged
    1 Thread(s)
    spikez, when you say LIMIT M,N, M is the starting row number, and N is the number of rows

    the first row is numbered 0

    so LIMIT 20,10 returns rows 21-30

    easy, eh?
    r937.com | rudy.ca | Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

Bookmarks

Posting Permissions

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