This topic is locked

Get birthdays from the current month and display

12/13/2007 3:55:18 PM
PHPRunner General questions
D
dorlisa author

Hellooo...
Can someone help me figure out how do I get birthdays that are in my members table to display on a page if their birthdays are in the current month?
Sorta like something I have below, but making it actually work.
[codebox]global $conn;

$str = "select username from _members where MONTH(bday) = MONTH(CURDATE())";

$rs = db_query($str,$conn);

while ($data = db_fetch_array($rs))

echo $data["username"].": ".$data["bday"]."
";
[/codebox]

J
Jane 12/14/2007

Hi,
try to use this code:

global $conn;

$str = "select username,bday from _members where MONTH(bday) = MONTH(CURDATE())";

$rs = db_query($str,$conn);

while ($data = db_fetch_array($rs))

echo $data["username"].": ".$data["bday"]."
";