Forum Moderators: open

Message Too Old, No Replies

Random Select With Time Limit

         

switchjohnny

2:19 am on Nov 8, 2007 (gmt 0)

10+ Year Member



Currently I'm doing this

$query = "SELECT * FROM table WHERE field ='query' ORDER BY RAND() LIMIT 1" or die (mysql_error());

Is there a way to display a random query with a time limit. For example, a user loads the page, and a random query comes up. Now if the user comes back in 20 minutes, the same query is there, but after 24 hours, the query has changed to something else?

This would be used for a quote of the day or something like that.

SeanW

3:23 am on Nov 8, 2007 (gmt 0)

10+ Year Member



Cache it to a file, another table, memcache, etc.

Sean