Results 1 to 3 of 3

Thread: How to Random ?

  1. #1

    Thread Starter
    Hyperactive Member AvisSoft's Avatar
    Join Date
    Sep 2002
    Location
    Chandigarh
    Posts
    459

    Resolved How to Random ?

    Hi!

    I have a mysql database filled with records. I want to get 5 random records..how do i do that ?

    Thanks!
    Last edited by AvisSoft; Oct 23rd, 2004 at 01:06 PM.
    Tapan Bhanot,
    CEO, Avis Software.
    Website: www.avissoftware.com

  2. #2
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945
    PHP Code:
    $query "SELECT * FROM tablename ORDER BY RAND() LIMIT 5"
    edit: by the way, a simple google search would have handed you the answer also.
    Last edited by ober0330; Oct 7th, 2004 at 09:24 AM.
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

  3. #3

    Thread Starter
    Hyperactive Member AvisSoft's Avatar
    Join Date
    Sep 2002
    Location
    Chandigarh
    Posts
    459
    Thanks! :-D
    Tapan Bhanot,
    CEO, Avis Software.
    Website: www.avissoftware.com

Posting Permissions

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



Click Here to Expand Forum to Full Width