Board index   FAQ   Search  
Register  Login
Board index PHP PHP Scripts

Randomly Choose Record from Drop menu

Links for php scripts

Moderators: macek, egami, gesf

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
kiwi
New php-forum User
New php-forum User
 
Posts: 124
Joined: Sun Feb 29, 2004 6:26 am

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();
User avatar
gesf
Moderator
Moderator
 
Posts: 1717
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden


Return to PHP Scripts

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.