|
Posted by gagal on 07/17/07 20:35
How do I get it to display None only once? Now it displays the word
for each record. Everything else works.
function displayBirthdays($connect, $db_table4)
{
$month = date("F");
echo "<H2>Birthdays For $month</H2>";
$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"$firstname $lastname [$day]<BR>";
}
else
{
echo "None";
}
}
}
[Back to original message]
|