dannybrazil Posted March 9, 2011 Share Posted March 9, 2011 Hello I have this code: $data = mysql_query("SELECT * FROM remind WHERE DATE_SUB(CURDATE(), INTERVAL 1 DAY) = event_date ") or die(mysql_error()); Basically what I need, I have a table (remind) with lots of dates of events (event_date). 1 day before the event and on the day of the event, I want to send an e-mail to my customers, automatically. This up mentioned code send e-mails to all the upcoming events, not ONLY to the ones TOMORROW or TODAY. I need something like this: If today is 01-01-2011 AND I have an event on 02-01-2011 I want that the SQL code will find and send the e-mail only for the event tomorrow and on 02-01-2011 send again the reminder of today's event. *I have events every day BUT I want to send a reminder ONLY 1 day before and on the day of the event. Any help ?? Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted March 9, 2011 Share Posted March 9, 2011 So what is the actual problem you're having? Is it sending an email to every user regardless of the date, or . . . ? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.