Jump to content

[SOLVED] How do you select a random customer bimonthly?


Presto-X

Recommended Posts

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?

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.

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.