Now you talk about weird!! I'm totally stumpted
Posted: Sun Dec 08, 2002 1:33 pm
for($i = 0; $i < $num_rows; $i++)
{
$row = mysql_fetch_row($result);
if($i % 2)
{
echo "<table border=\"1\" width=\"700px\">";
}
else
{
echo "<table border=\"1\" width=\"700px\">";
}
echo "<tr>";
echo "<td>";
for($k = 0; $k < 1; $k++)
{
$title = stripslashes($row[$k]);
echo " * <b><a href=\"update_module.php?title=$title&id=$i\">$title</a></b></u> * ";
echo "<br>";
echo "<b>Project Number: </b> ".$row[1];
echo "<br>";
echo "<b>Primary POC: </b>  ";
echo "<b>".$row[2]."<br>";
echo "<b>Alternate POC: </b> ";
echo "<b>".$row[3]."<br>";
echo "<br>";
echo "Project Description: ";
echo $desc[$i][0];
}
echo "</td>";
echo "</tr>";
echo "</table>";
}
This works great while the value of $i is 1 - 3. When it hits 4, it still displays everything ok, but when you click the link and try to pass the $id var, it says on the next page (where you make a reference to $id) that $id is an undefined variable, like it has no value. What's really weird is if you'll notice the $desc[][] echo. It comes AFTER the $id var is defined for passing through the link. And guess what...the desc[][] echo's index 4 great. Someone please tell me what I'm missing.
{
$row = mysql_fetch_row($result);
if($i % 2)
{
echo "<table border=\"1\" width=\"700px\">";
}
else
{
echo "<table border=\"1\" width=\"700px\">";
}
echo "<tr>";
echo "<td>";
for($k = 0; $k < 1; $k++)
{
$title = stripslashes($row[$k]);
echo " * <b><a href=\"update_module.php?title=$title&id=$i\">$title</a></b></u> * ";
echo "<br>";
echo "<b>Project Number: </b> ".$row[1];
echo "<br>";
echo "<b>Primary POC: </b>  ";
echo "<b>".$row[2]."<br>";
echo "<b>Alternate POC: </b> ";
echo "<b>".$row[3]."<br>";
echo "<br>";
echo "Project Description: ";
echo $desc[$i][0];
}
echo "</td>";
echo "</tr>";
echo "</table>";
}
This works great while the value of $i is 1 - 3. When it hits 4, it still displays everything ok, but when you click the link and try to pass the $id var, it says on the next page (where you make a reference to $id) that $id is an undefined variable, like it has no value. What's really weird is if you'll notice the $desc[][] echo. It comes AFTER the $id var is defined for passing through the link. And guess what...the desc[][] echo's index 4 great. Someone please tell me what I'm missing.