The Arcive of vBulletin Modifications Site. |
|
|
#1
|
||||
|
||||
|
I am trying to display the user birthdays this month
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>, ";
}
}
}
else{
echo "No Birthdays This Month";
}
?>
|
|
#2
|
|||
|
|||
|
Change your query to use
Code:
...WHERE MONTH(birthday_search) = MONTH(NOW()) (add the _search). I guess it's because the birthday field isn't one of the date formats that MySql will use or something like that. Anyway, I the rest of your code can still use the birthday column if you want. |
|
#3
|
|||
|
|||
|
works??
|
|
#4
|
||||
|
||||
|
I have tried this code and it's not working - thoughts anyone?
|
|
#5
|
||||
|
||||
|
If the user has, Hide Age and Date of Birth or Display Only Age set, they should not show up.
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|