Im developing a log system at the moment. My knowledge of PHP is good, mysqli I just know the basic things.
I want to send a email(cronjob) 3 days before the next event, the date is stored in the database. The email is stored in the users table, and the new_event column is in a different table.
My question is how do I get all the email adresses that are 3 days away from the current date?
I'm not asking for a premade query, I just need a push in the right direction, of how to handle this.
You need something like this to add 3 days:
SELECT *
FROM table
WHERE date_send = DATE_ADD(CURDATE(), INTERVAL 3 DAY)
You can read more at:
http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_adddate