Here is a slight modification of the code above. Basically all it does it checks to see if there are any birthdays ... if not it writes a message saying "No birthdays today"
PHP Code:
<?
require (".forum/admin/config.php"); // add your details here
$db=mysql_connect($servername,$dbusername,$dbpassword) or die("Can't open connection to MySQL");
mysql_select_db($dbname) or die("Can't select database");
$today = date("m-d",time());
$birthdays = mysql_query("SELECT * FROM user WHERE birthday LIKE('%-$today')",$db) or die (mysql_error());
if ("$birthdays" != ""){
echo "There are no birthdays today";
} else {
while ($birthday = mysql_fetch_array($birthdays)) {
$bd_user = $birthday[username];
$bd_userid = $birthday[username];
$datebits = explode("-", $birthday[birthday]);
$bdage = date("Y") - $datebits[0];
if ($bdage > 0) $age = "($bdage)";
else $age = "";
echo "<b>? </b><a href=\".forum/member.php?action=getinfo&userid=$bd_userid\">$bd_user's birthday</a> $age<br>"; //add your details here
}
}
?>
simple ... Thanks for the original script !!!