Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script to run daily queries? 1

Status
Not open for further replies.

gdbsti

Technical User
Jul 15, 2003
29
US
(I'm not sure if this question belongs here, in MySQL or XML forums?)

Hi all,
A little bit of direction is required :)

I want to give my customers the option (opt-in/out) of how often I send them email updates of their account status, and an email reminder of pending account expiration.

I have added 2 new columns ("ContactFrequency" and "ExpireAdvisory") to the 'Customer' table in my database. Customers select options of "Contact me every: 3 months, 6 months, 12 months or Never", and "Remind me 1 week, 3 weeks, or never before my account expires" from their user admin (.php) page.

I can calculate when these dates become current using .php date, mktime and floor statements.

My Questions are:
1. How do I activate a query to check the database to establish if an auto emailer should be sent out. Is this a script I run once daily from a scheduling program?, or should I use a Cron Job Manager via the server to run a xml or php script?

2. Am I approaching this task from the wrong direction? Are their code snippets or an entire program that can do this job outright?

I have searched around but may be using the wrong keywords to find what I am looking for. I hope what I am asking is not too confusing.
Any input would be much appreciated.

TIA

GDB
 
Thanks sleipnir,
Your endorsement of the fact that I'm going in the right direction speaks volumes to me!

I'll go and study up on cron and start working on a script. If you know of where I may view some sample scripts (associated to this task) to help jump start me, that would be great too!

Cheers

GDB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top