June 2nd in Linux/Unix by pbu .
MySQL Query to Select Random Records
Often in many situations during programming you might need to pull randomly selected records from a MySQL Database. For example displaying 5 randomly selected ads in your site. All that is needed is use rand() function.
SELECT ID FROM
ORDER BY RAND() LIMIT 5
Make sure you use the LIMIT clause as otherwise …




