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...
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)
精彩评论