Page 1 of 1

how to show...

Posted: Fri Feb 18, 2005 10:53 am
by kanchan
i wanna show the name of users whose birthday is coming near by capturing their month day and year.... from the table...



how's that possible???

Posted: Fri Feb 18, 2005 11:52 am
by anjanesh

Code: Select all

$BirthDaysRes=@mysql_query("SELECT FullName,DOB FROM Classmates WHERE DATE_FORMAT(NOW(),'%d%m')=DATE_FORMAT(DOB,'%d%m')");
If the server is different from the location of the place from where a user is browsign the page, then use this :

Code: Select all

$BirthDaysRes=@mysql_query("SELECT FullName,DOB FROM Classmates WHERE DATE_FORMAT(NOW()+INTERVAL '".$GLOBALSї'TimeZone']."' HOUR_MINUTE,'%d%m')=DATE_FORMAT(DOB,'%d%m')");