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... Link to comment https://forums.phpfreaks.com/topic/22270-workout-out-birthdays/ 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] Link to comment https://forums.phpfreaks.com/topic/22270-workout-out-birthdays/#findComment-99722 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 Link to comment https://forums.phpfreaks.com/topic/22270-workout-out-birthdays/#findComment-99737 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] Link to comment https://forums.phpfreaks.com/topic/22270-workout-out-birthdays/#findComment-99759 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 Link to comment https://forums.phpfreaks.com/topic/22270-workout-out-birthdays/#findComment-99819 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.