Page 1 of 1
Random selections from database
Posted: Mon Sep 01, 2008 9:59 am
by kippy
What is the easiest and safest way to pull 5 random items from my database. I am thinking the rand function can be used in some way, but I am not sure how safe etc this type of action will be? Thanks for any advice.

Re: Random selections from database
Posted: Mon Sep 01, 2008 10:03 am
by onion2k
"ORDER BY rand LIMIT 5" I'd say. It's certainly the easiest.
Re: Random selections from database
Posted: Mon Sep 01, 2008 10:18 am
by kippy
That is where I was headed but just wanted to make sure I wasn't missing anything. Thanks.