View Single Post
Old 10-06-2012, 09:55 PM   PM User | #1
Feckie
Regular Coder

 
Join Date: Jan 2009
Posts: 196
Thanks: 29
Thanked 0 Times in 0 Posts
Feckie has a little shameless behaviour in the past
Birthdays in Current Month vb 4.2

I am trying to display the user birthdays this month in vbulletin 4.2

I have done the script below, although there is a birthday set this month
it shows " No Birthdays This Month "

Can anyone help please



Code:
<?php


include("connect.php");


$result = mysql_query("SELECT userid,username,birthday FROM user WHERE MONTH(birthday) = MONTH(NOW())");
    if( mysql_num_rows( $result ) != 0 ) {
        while ( $row = mysql_fetch_array($result))
{
    $userid = $user['userid'];
    $username = $user['username'];
    $birthday = $user['birthday'];
    $birthday = explode("-", $birthday);
    $birthmonth = $birthday[0];
    if ($birthmonth = $month)
    {
        echo "<a href='member.php?u=$userid'>$username</a>,&nbsp;";
    }

}
}
else{
        echo "No Birthdays This Month";
    }
?>

Last edited by Feckie; 10-07-2012 at 11:47 PM..
Feckie is offline   Reply With Quote