deansaddigh Posted January 7, 2010 Share Posted January 7, 2010 How can i do the following code please if possible? //Automatically archive booking after one year of NOW() $archivequery = "SELECT * FROM bookings WHERE date is 1 year less than current date" £queryresult =mysql_query($archivequery) Link to comment https://forums.phpfreaks.com/topic/187545-how-can-i-get-all-records-from-a-db-where-there-date-field-is-one-year-ago/ Share on other sites More sharing options...
Mchl Posted January 7, 2010 Share Posted January 7, 2010 WHERE `date` = CURDATE() - INTERVAL 1 YEAR Link to comment https://forums.phpfreaks.com/topic/187545-how-can-i-get-all-records-from-a-db-where-there-date-field-is-one-year-ago/#findComment-990188 Share on other sites More sharing options...
deansaddigh Posted January 7, 2010 Author Share Posted January 7, 2010 Thanks very much. Link to comment https://forums.phpfreaks.com/topic/187545-how-can-i-get-all-records-from-a-db-where-there-date-field-is-one-year-ago/#findComment-990191 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.