Never been to CodeSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

About this user

Dan Berlyoung

1 total

Select a random record from a MySQL database

// description of your code here
I needed to select 5 random records from a MySQL database and found this little squib of code from http://peterfreitag.com/item/466.cfm

SELECT column FROM table ORDER BY RAND() LIMIT 5
1 total