Solved

MySQL Database Script

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

786 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