Solved

MySQL Database Script

Posted on 2011-03-23
3
278 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

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

708 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

10 Experts available now in Live!

Get 1:1 Help Now