SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 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 Advisor
    Only a woman can read between the lines of a one word answer.....

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,336
    Mentioned
    63 Post(s)
    Tagged
    3 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?
    rudy.ca | @rudydotca
    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
  •