#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Location
    Ontario, Canada
    Posts
    498
    Rep Power
    18
    Is there a query tag you can use to limit the number of results returned from mysql? Say for instance, I want to make a Query only return the first 15 results. Can I add a query tag along the lines of this:
    SELECT * from table UNTIL field='limit'?

    Thanks for any help.

    ------------------
    To alcohol! The cause of, and solution to, all of life's problems. -- Homer Simpson
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    114
    Rep Power
    15
    mysql>SELECT * FROM table_name LIMIT n;
    returns n rows.
    mysql>SELECT * FROM table_name LIMIT m, n;
    returns n rows, starting at m.

    You should by a copy of MySQL by Paul Dubois. It is a good book.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Location
    Ontario, Canada
    Posts
    498
    Rep Power
    18
    Thanks, bud.

    Who needs books, I've got the DevShed forums. :P

    ------------------
    To alcohol! The cause of, and solution to, all of life's problems. -- Homer Simpson

Similar Threads

  1. Replies: 2
    Last Post: February 12th, 2004, 07:29 AM
  2. PEAR DB numRows() not returning integer
    By alzheimer in forum PHP Development
    Replies: 1
    Last Post: February 5th, 2004, 10:22 PM
  3. Replies: 1
    Last Post: February 5th, 2004, 06:17 AM
  4. Returning things from this week From mysql database
    By Angel2k1 in forum PHP Development
    Replies: 4
    Last Post: January 28th, 2004, 03:29 PM

IMN logo majestic logo threadwatch logo seochat tools logo