Presto-X Posted December 6, 2008 Share Posted December 6, 2008 Hello everyone, I’m working on a site and I want to have a random row pull from a customer’s table with in our database bimonthly (once a month). I have done something like this where the php code pulls a row from the database randomly every time the page is loaded but I want this to pull a custom from the database for a Featured Customer section on our home page once a month. I was thinking of having another table that would hold a date, and every time the page is loaded it looks to see when the current FC was selected and then compare it with the current month if they are not the same select a new one. Or is there a batter way to go about this, what do you guys think? Link to comment https://forums.phpfreaks.com/topic/135739-solved-how-do-you-select-a-random-customer-bimonthly/ Share on other sites More sharing options...
balistic Posted December 6, 2008 Share Posted December 6, 2008 just set the script to run monthly using a cron job http://www.tech-faq.com/create-cron-job.shtml cpanel has a spot for setting them up easily http://www.siteground.com/tutorials/cpanel/cron_jobs.htm cpanel tutorial as for storing the username generated, you could store it in the database or save it to a file and include it where wanted. Link to comment https://forums.phpfreaks.com/topic/135739-solved-how-do-you-select-a-random-customer-bimonthly/#findComment-707251 Share on other sites More sharing options...
Presto-X Posted December 6, 2008 Author Share Posted December 6, 2008 Hey thanks for the reply Balistic, I have never used cron jobs before, damn that was to easy, thanks so much... Cron jobs opens up a lot of cool ideas. Link to comment https://forums.phpfreaks.com/topic/135739-solved-how-do-you-select-a-random-customer-bimonthly/#findComment-707404 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.