I think there are 2 ways you could solve this problem. You could either execute the query to see if there are any birthdays on that particular day within the loop where you are printing out the days. That means a query for each day.
Or, you could grab all birthdays within the month and stuff them into an array of some sort that keys off of the day and then when printing out each day you could check the array.
Sorry I can't be of much more help. Kinda tough to figure out what to do without having it to work on. Though it does look like a pretty cool addition.