Be a Supporter!

MYSQL Question

  • 766 Views
  • 2 Replies
New Topic Respond to this Topic
jonno
jonno
  • Member since: Dec. 15, 1999
  • Offline.
Forum Stats
Member
Level 16
Blank Slate
MYSQL Question 2001-07-22 15:23:21 Reply

ok, i have a quickie mysql question, i have a database that holds pictures and other info. what is the mysql script to have sql choose a random row id and display it? thanks

liljim
liljim
  • Member since: Dec. 16, 1999
  • Offline.
Forum Stats
Staff
Level 28
Blank Slate
Response to MYSQL Question 2001-07-22 17:39:22 Reply

At 7/22/01 03:23 PM, jonno wrote: ok, i have a quickie mysql question, i have a database that holds pictures and other info. what is the mysql script to have sql choose a random row id and display it? thanks

SELECT * FROM table ORDER BY RAND() LIMIT 1

:)

jonno
jonno
  • Member since: Dec. 15, 1999
  • Offline.
Forum Stats
Member
Level 16
Blank Slate
Response to MYSQL Question 2001-07-22 18:10:00 Reply

At 7/22/01 05:39 PM, liljim wrote:
At 7/22/01 03:23 PM, jonno wrote: ok, i have a quickie mysql question, i have a database that holds pictures and other info. what is the mysql script to have sql choose a random row id and display it? thanks
SELECT * FROM table ORDER BY RAND() LIMIT 1

)

THANKS DUDE!