Fero
Fero

Reputation: 13315

Need to send reminder mail one day before using MYSQL

I need to send a reminder mail one day before the task date. I know about this thing can be done by using cron job.

For example, If my friends birthday is on 04-feb-2011 i need to receive a reminder mail on 03-feb-2011.

I am having all the details in the mysql database.

EDIT:

But is stored the birthday date the following format

--> birthDay : Wed Feb 09 2011 00:00:00 GMT+ 0530 (India Standard Time)

how do i compare now in this case?

But could any one tell me how the query should be?

Any help will be grateful and thankful..

thanks in advance...

Upvotes: 0

Views: 1508

Answers (1)

Haim Evgi
Haim Evgi

Reputation: 125486

you need to run a cron job every day, in this cron job you check who has a birthday tomorrow.

the query is like:

select * from mytable where 
date = DATE_ADD(curdate(), INTERVAL 1 DAY) 

Upvotes: 4

Related Questions