Posted: Tue Jul 10, 2007 10:05 pm Post subject: Tips to select Random rows from mysql
I was doing my small project after the central australia and one of the feature is to select photos randomly from MySQL table. And below is what I used to select random row:
Code:
"SELECT * FROM tableName order by rand() limit 10"
Note that the limit is 10 because I just wish to select 10 rows.
Hope that's helpful for someone with similar issue.
Cheers,
GuitarmAn