Possible Duplicate:
MySQL select 10 random rows from 600K rows fast
There are many varying examples across the web, but I am hoping someone has a solution that fits what I am looking for... Surely I cannot be the only one!
I am building a photography website and want to display 50+ image thumbnails on the landing page. The kicker is that I want it to display pictures randomly using PHP and without duplication. I also want each image to have its own, unique href and title params.
So, I have created a mySQL table that holds:
id image_path, image_href, image_title
I was figuring I would easily re-size the images on my own and put them in a folder in the root directory and then call it in the row image_path.
Does anyone have an idea how to do this the most efficient way? I have heard that rand() sucks when the database gets big. The database will grow to tens of thousands of images.
Let me know if you need/want clarification.
Thanks!!!
Edit: I may have come across the answer in my research, but I'm pretty new to PHP... :)