Saturday, May 7, 2011

MySQL Select Random Row

Found a good post here: http://www.greggdev.com/web/articles.php?id=6 on this.
Basically you just add this to your query -> "order by rand() limit 1"
e.g. select saying from sayings order by rand() limit 1

No comments:

Followers