Randomly Choose Record from Drop menu

Links for php scripts

Moderators: macek, egami, gesf

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

Randomly Choose Record from Drop menu

Postby kiwi » 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: 1717
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden

Postby gesf » 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();

Return to “PHP Scripts”

Who is online

Users browsing this forum: No registered users and 3 guests