This seems to still not work. I’ve tried both of the codes you submitted. More than likely I’m not explaining it correctly.
My field “enddate” as a datetime formatted as: MM-DD-YYYY HH:MM
Basically I have a document (we’ll call that notifications.php) that searches for a record with a timestamp of 30 days (upcoming only) from the database. Currently when it finds a record that is upcoming within 30 days, it the script echo’s a CSS alert. What I’m not seeing is once the enddate has past, it should no longer see the record, so the alert should no longer be present.
But for some reason it’s not “disappearing”.
Here is my current SQL Query:
[php]
SELECT * FROM notifications WHERE status = ‘Current’ AND startdate >= NOW() AND DATE_ADD(NOW(), INTERVAL 30 DAY) AND enddate < NOW()
[/php]
I feel like I have the general idea, but for some reason I can’t seem to get it to return any records.