Reputation: 15
So i'm trying to create a daily offer for my exam project - The idea is to extract information from my DB and make some kind of random function that calls out a random product each day, but for now i'm pretty much stuck nowhere.
Any great guides or solutions?
Upvotes: 0
Views: 62
Reputation: 3864
Here's how you could do it :
id_product
and date
should suffice) -- let's call it daily_products
daily_products
products
table which will return only one line with an ORDER BY RAND()
, then store the product id and today's date in daily_products
cronjob
which will execute every day, say at 00:01Upvotes: 1