# Interesting query

**URL:** <https://forum.kirupa.com/t/interesting-query/257718>\
**Category:** Uncategorized\
**Created:** [April 16, 2008, 4:14pm UTC](https://forum.kirupa.com/t/interesting-query/257718 "2008-04-16T16:14:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tara\_irvine](https://avatars.discourse-cdn.com/v4/letter/t/ba8739/32.png) [@tara\_irvine](https://forum.kirupa.com/u/tara_irvine)\
**Post date:** [April 16, 2008, 4:14pm UTC](https://forum.kirupa.com/t/interesting-query/257718/1 "2008-04-16T16:14:07Z")

</div>

hi guys i have a qualm. I am developing a website that when the user logs in, the summary page will display the nearest birthday from the database. What kind of php query would I use. I know that I need to get the date via php so should the query be along the lines of  
“SELECT \* from database WHERE $date \<= $todaysdate (by 14?) && $month \<= &todaysmonth (by1)” syntax is way off but thats kinda what I need to create. If there is a birthday in the database within 14 days and 1 month of todays date I would like it to be displayed.

any ideas or suggestions on the workings of this. I’m lost and struggling lol 🙂  
:fab:
