MySQL Random Selection
So, you want to find a random result from your MySQL database? Yeah, me too. I have struggled for ages, using fancy queries. If I was clever I would have used this MySQL statement:
SELECT * FROM mytable WHERE myfield = 'something' ORDER BY RAND() LIMIT 1

0 Comments:
Post a Comment
<< Home