Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    Regular Coder
    Join Date
    Jan 2007
    Thanked 0 Times in 0 Posts

    Selecting 2 random rows

    Hey guys,

    i want to select two random rows from a table.

    Select 2 FROM `items`

    thats what i thought- but that doesn't seem to work. Any ideas?

    EDIT: nevermind, i found it out. It was, for anyone wondering, SELECT * FROM `items` ORDER BY RAND() LIMIT 2
    Last edited by ole90; 06-09-2007 at 03:28 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