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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.