What I am trying to do is print an event directly on a calendar if it exists for that day....the problem with the block of code below is that it prints all the rows for a given day...say 4 rows are returned...it will print on with the event and 3 without...in other words it goes through the while loop for each row returned....how do I limit this to find just the condition that I want and stop and go to the next day ($d)...PLEASE HELP!!!! I'm sorry but I'm a newbie.....
$query = "SELECT * FROM $TableName2 where class_id = '$class_id'";
$result = mysql_query($query, $Link);
$numrows = mysql_num_rows($result);
$cal_date = ($y."-".$m."-".$d);
while ($row = mysql_fetch_array($result)){
if ($row['date']==$cal_date)
{print "<td class='tcell' bgcolor=#CCCCCC valign=\"top\" height=\"100\">$d $row[description]</td>";
}
else {print "<td class='tcell' bgcolor=#CCCCCC valign=\"top\" height=\"100\">$d yuck</td>";
}
}