for loop problem
Posted: Wed Aug 10, 2005 1:08 pm
I keep getting an undefined offset 21 on with this code: any suggestions?
if (mysql_num_rows($result) > 0) {
echo "<table cellpadding=1 border=1>";
while($row = mysql_fetch_row($result)) {
echo "<tr>";
for ($i = 0; $i <= $f; $i++){
echo "<td>";
echo $row[$i]; <--Error Line
echo "</td>";
}
echo "</tr>";
}
echo "</table>";
}
else {
echo "No Rows Found!";
}
echo $i."found";
mysql_free_result($result);
if (mysql_num_rows($result) > 0) {
echo "<table cellpadding=1 border=1>";
while($row = mysql_fetch_row($result)) {
echo "<tr>";
for ($i = 0; $i <= $f; $i++){
echo "<td>";
echo $row[$i]; <--Error Line
echo "</td>";
}
echo "</tr>";
}
echo "</table>";
}
else {
echo "No Rows Found!";
}
echo $i."found";
mysql_free_result($result);