Solved

MySQL Database Script

Posted on 2011-03-23
3
279 Views
Last Modified: 2012-05-11
I have a MySQL database that consist of first names, last names, and dates. Does anyone know if it is possible for me to use some type of script that runs agains certain date fields & if a date is within 6 days of todays date, it will automatically send an email to someone reminding them they are within 6 days of that date?
0
Comment
Question by:wantabe2
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
tygrus2 earned 500 total points
ID: 35203179
Your problem is in three parts.
1) List people who have "expiryDate - TodaysDate < 6" condition;
2) Add another table or field to record when they were notified;
3) Send email to required users in step1 to warn of expiry that have not previously been notified, see step2.
The 2nd part is required if you only want to send it once to a user and not everyday as a countdown. You may need to round the dates to 0 decimal places for 00:00AM which could help to simplyfy the "expiryDate - TodaysDate = 6" condition. What do you want to do with those who have reached the expiryDate ? How many reminders ?

The third part is more difficult but should be able to do in PHP if you have a mail server that will send email without authentication. There may be other ways to automate the process but you may like the manual trigger to check the list before sending.
0
 
LVL 15

Author Comment

by:wantabe2
ID: 35206161
Does anyone have a sample script to do some of this?
0
 
LVL 15

Author Closing Comment

by:wantabe2
ID: 35214261
This did not help me but thanks anyway.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now