onlyican Posted September 27, 2006 Share Posted September 27, 2006 First, on the note of BirthdaysHappy Birthday google, 8 years, they grow up soo fastAnywayI store users DOB's in the MySQL table, in Mysql Format (2006-09-27)WHats the best way to work out whos birthday it is todayI was thinking either$today = date("m-d");$query1 = "SELECT * FROM members WHERE dob LIKE '%".$today."' ";OR$today = date("m-d");$query1 = "SELECT * FROM members WHERE dob BETWEEN '1000-".$today."' AND '30-".$today."'";What do u thinkOr any better ideasAlso,Is there a database I can get Celebs birthdays fromSo I can This persons birthday is also today... Quote Link to comment Share on other sites More sharing options...
obsidian Posted September 27, 2006 Share Posted September 27, 2006 as for the individual user b-days, just use this:[code]<?php$day = date('d');$mon = date('m');$sql = mysql_query("SELECT username FROM users WHERE MONTH(DOB) = '$mon' AND DAYOFMONTH(DOB) = '$day'");?>[/code] Quote Link to comment Share on other sites More sharing options...
onlyican Posted September 27, 2006 Author Share Posted September 27, 2006 Wicked, I didn't know about the MONTH and DAY features Quote Link to comment Share on other sites More sharing options...
acdx Posted September 27, 2006 Share Posted September 27, 2006 Even better is:[code]<?php$query1 = mysql_query("select * from members where month(dob) = month(curdate()) and day(dob) = day(curdate())");?>[/code] Quote Link to comment Share on other sites More sharing options...
onlyican Posted September 27, 2006 Author Share Posted September 27, 2006 ExcellentNow I need to build a database to Famous Disabled people, and there birthdaysWish me luck 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.