Jump to content

Selecting a random record every X hours


tHud

Recommended Posts

Hello :)

 

I would like to be able to 'feature' a certain product every 'x' hours (or perhaps daily).

 

As far as I can see, this seems to work on an 'instantaneous' basis...

 

SELECT * FROM `products` ORDER BY RAND() LIMIT 0,1; 

 

Is there a way that I could adapt this to work with a time-frame? Maybe 12 hourly? Or daily?

 

Thanks for looking :)

Link to comment
https://forums.phpfreaks.com/topic/214474-selecting-a-random-record-every-x-hours/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.