Here is a snippet of code I am having trouble with if you can't tell it is a calendar loop
comapring dates in a database
it first sets filler spots to a shade and then starts processing the days it compares the day in the for loop to a day in a database if they match it shades it yellow if it doesn't it stays white or at least that is how it is supposed to work
What happens is that the internal while loop that contains the row array holding the database row only get checked the first time. I tried to unset the $row variable but it didn't seem to have any effect it still only processes once ie. when the for loop hits the first day and then it is skipped I believe because the while statement is complete and the $row array still holds the data from the first pass through the loop.
I hope it is just a syntax error on my part not some quirky thing
I am fairly new to PHP so I am betting on the syntax for unsetting an array element!!!
Jeff
for($i=0;$i <= $paddedMonthLength; $i++) {
if ($i==0)
echo"<tr>";
else{
if(($i - $day)<1)
echo "<td bgcolor='#eeeeee'> </td>";
else{
$DayValue=$i-$day;
while ($row = mysql_fetch_array($result, MYSQL_BOTH)) {
echo "$row[5] $row[6] $DayValue<BR>";
if(($DayValue>=$row[5])AND($DayValue<=$row[6]))
$color="#FFFF00";
else
$color="#FFFFFF";
}
echo "<td bgcolor='$color'>$DayValue </td>\n";
unset ($row);
}
if($i%7==0)
echo "</tr>\n<tr>";
}
}