开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜