# If statement - current date and expiry date

**URL:** <https://forum.kirupa.com/t/if-statement-current-date-and-expiry-date/299896>\
**Category:** Uncategorized\
**Created:** [November 12, 2009, 10:14am UTC](https://forum.kirupa.com/t/if-statement-current-date-and-expiry-date/299896 "2009-11-12T10:14:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wispas](https://avatars.discourse-cdn.com/v4/letter/w/9de0a6/32.png) [@wispas](https://forum.kirupa.com/u/wispas)\
**Post date:** [November 12, 2009, 10:14am UTC](https://forum.kirupa.com/t/if-statement-current-date-and-expiry-date/299896/1 "2009-11-12T10:14:07Z")

</div>

I have a expiry\_date field in my mysql database along with some other fields…

what i want to do is write a php code that retrieves and displays only the records from the mysql database that have not expired. this is done by checking the expiry\_date field of a record and looking at todays date…

someone please help me.
