I am working on my members system and I want to display a "Featured Member" in the sidebar every 30 days, I want the selection to be random. Any ideas? Tips?
EDIT: I understand how to query the database to display a random row, I was wondering what I would have to do to display the data every 30 days
This is actually 2 questions:
~ get a random member
~ display a member for 30 days
The first part can be done using the SQL query from JW or by a range of other query methods.
The second part has to be done using PHP. There are a number of ways to do this and the most interesting part of your problem to me is changing it every 30 days.
Personally I'd either a cron job or use one a solutions based around whatever month it is and storing the random member with reference to that month stamp. If the month stamp changed the random member stored changes. Something like that.
--use the table to select and show as appropriate.
SELECT * FROM Members ORDER BY Rand() LIMIT 1
That is all. You could do a cron job to run this query every 30 days.