I am trying to get all entries that are greater than or equal to 7 days from today. I see it is not as easy as adding a number to the date.
How can I write that to the query below?:
SELECT * FROM `table_name` WHERE `date` >= NOW() + 7
Thx.
Depends on how 'date' is stored.
Is your 'date' field stored as a timestamp? If so, just add 7 day's worth of seconds (604800), to the result of the time() function.
SELECT * FROM table_name WHERE date >= DATEADD(CURDATE(), INTERVAL +7 DAY);
MySQL Date and Time Functions