Show Random quote from database?
I have a database that holds quotes, i.e开发者_开发问答 Mysql " id,user_who_posted,quote,year,author " I would like to make it show a random quote by id.Is this possible?
SELECT id,user_who_posted,quote,year,author FROM table ORDER BY RAND() LIMIT 1
SELECT id,user_who_posted,quote,year,author
FROM table
ORDER BY RAND()
LIMIT 1
more randoms at http://www.petefreitag.com/item/466.cfm
精彩评论