Jump to content

Date manipulation


dannybrazil

Recommended Posts

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 ??

Link to comment
https://forums.phpfreaks.com/topic/230107-date-manipulation/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.