izbryte Posted December 7, 2007 Share Posted December 7, 2007 I have a page where people can make postings but I only want them to be viewable for 30 days. I'm putting it into the database with the NOW() function. When I bring it back out how do I check to make sure the posting hasn't expired? Link to comment https://forums.phpfreaks.com/topic/80552-question-about-date/ Share on other sites More sharing options...
pocobueno1388 Posted December 7, 2007 Share Posted December 7, 2007 Only select the ones that haven't expired, like this: SELECT * FROM postings WHERE post_date < (NOW() - INTERVAL 30 DAY) Link to comment https://forums.phpfreaks.com/topic/80552-question-about-date/#findComment-408440 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.