Hi all,
(Working with PHP and MySQL)
I have table "events" that list events by the day they happen.
How can I have it show only those events that are going to happen in the next 7 days from "now"?
Currently i have the following code:
SELECT * FROM events WHERE TO_DAYS(eventdate) - TO_DAYS(now()) <= 7 AND eventscat_id=1;
But it will show events that happened before now() as well.
I guess I need something in the where clause to not include anything that is <= 0 when the where clause subtracts now() from the eventdate.
Any ideas?
(Working with PHP and MySQL)
I have table "events" that list events by the day they happen.
How can I have it show only those events that are going to happen in the next 7 days from "now"?
Currently i have the following code:
SELECT * FROM events WHERE TO_DAYS(eventdate) - TO_DAYS(now()) <= 7 AND eventscat_id=1;
But it will show events that happened before now() as well.
I guess I need something in the where clause to not include anything that is <= 0 when the where clause subtracts now() from the eventdate.
Any ideas?