Randomly Choose Record from Drop menu

Links for php scripts

Moderators: egami, macek, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 124
Joined: Sun Feb 29, 2004 6:26 am

Wed Sep 15, 2004 4:44 pm

I can show a table record in a drop menu, but now i want to randomly select or show the record in the drop menu, e.g if the drop menu got 10 records, i want to randomly show, may be the 5rd record, how to do it? thanks

User avatar
Posts: 1716
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden

Thu Sep 16, 2004 1:05 am

Make it in your MySql query!

Code: Select all

mysql> SELECT id, nama FROM whatever ORDER BY rand();
Gonçalo "gesf" Fontoura

gesf.org | sessionstart.com | urlms.com

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest