I have database entrys that have a date column ( mySQL date type )
in this format(2011-5-30). I want to compare that date with the current server date and with 3 days before that day, to automatically send an email to a specified address.

I have database entrys that have a date column ( mySQL date type )
in this format(2011-5-30). I want to compare that date with the current server date and with 3 days before that day, to automatically send an email to a specified address.

select * from tbl_name where date_field_name=DATE_ADD(NOW(), INTERVAL 3 DAY)

Get all the mail ids from result set and send mails

sorry I don't know how to compare dates then send email

sorry I don't know how to compare dates then send email

Post your code with code tags

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.