I want to make a notification system. Shortly.. to compare two dates, the only problem is that i want to compare the months. to see if a month or two have passed from last notification.
i want to use one or two months from an entry in a mysql database.
the client must select when the notification must come, one or two months.
thank you, Sebastian
Your statement should look like this:
SELECT * FROM table WHERE date_column + INTERVAL 1 MONTH >= NOW()
You add 1 (or 2) month to the date of the column in which the date is stored and compare it to the current time "NOW()".
That works with DATE, DATETIME and TIMESTAMP columns.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With