When there are no birthdays for a particular month, I would like for it to say "There are no birthdays this month". When I tried, I got the phrase returned for every record in the db. Any suggestions?
function displayBirthdays($connect, $db_table4){$sql = "SELECT dob, lastName, firstName FROM $db_table4 ORDER BY dob";$result = mysql_query ($sql, $connect) or die ('Query failed: ' .mysql_error()); while ($row = mysql_fetch_array($result)){$lastname = $row["lastName"];$firstname = $row["firstName"];$dob = $row['dob'];$month = substr($dob,0,2);$day = substr($dob,3,2);$currentmonth = date("m");if ($month == $currentmonth && $month != 00 ){echo"<FONT SIZE='+1'>$firstname $lastname - [$day]</FONT><BR>";}}}