how to show...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kanchan
Forum Commoner
Posts: 80
Joined: Tue Nov 30, 2004 12:03 pm

how to show...

Post 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???
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post 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')");
Post Reply