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? Quote Link to comment 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) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.