I have a table with these columns:
+------------------------------------------------------+
| ad_id | ad_title | active | placed_on | duration |
+------------------------------------------------------+
| 1 | First | 1 | 2010-19-10 | 365 |
+------------------------------------------------------+
| 2 | Second | 1 | 2011-18-10 | 365 |
+------------------------------------------------------+
It's a table for listings that expire in 365 days from day it's placed_on and I wanted to create a PHP + SQL statement that would show listings that expire this month (e.g. first ad which was placed last year and expires today). How can I do math on those dates, like this 2010-19-10 + 365? and show the ones that expire this month. My brain froze after getting to:
mysql_query("SELECT `ad_id`, `ad_title`, `active` FROM `listings` WHERE `placed_on` = ``;
Is it even possible, if yes, please advise me. Thank you!