从MySQL数据库中选择随机条目 [英] Selecting random entry from MySQL Database
本文介绍了从MySQL数据库中选择随机条目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用PHP从MySQL数据库中选择一个随机条目?
How can I select a single random entry from a MySQL database using PHP?
我要选择Author,AuthorText和Date吗?
I want to select the Author, AuthorText, and Date?
推荐答案
SELECT Author, AuthorText, Date FROM table ORDER BY RAND() LIMIT 1
这篇关于从MySQL数据库中选择随机条目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文