Page 1 of 1

Now you talk about weird!! I'm totally stumpted

Posted: Sun Dec 08, 2002 1:33 pm
by rathlon
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>&nbsp;&nbsp;".$row[1];
echo "<br>";
echo "<b>Primary POC: </b>&nbsp;&nbsp;&nbsp;&nbsp";
echo "<b>".$row[2]."<br>";
echo "<b>Alternate POC: </b>&nbsp;&nbsp;";
echo "<b>".$row[3]."<br>";
echo "<br>";
echo "Project Description:&nbsp;&nbsp;";
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.

Posted: Sun Dec 08, 2002 6:07 pm
by rathlon
Allow me to answer myself. Seems mysql had a problem with the name "test #2". Even though I'm using the addslashes() function in the insert script...something isn't clicking right. Can someone explain further?

Posted: Mon Dec 09, 2002 5:28 am
by 9902468
Ok. Sounds like you should
1. read some php tut
2. understand it
3. write code

But anyway put your code between code tags so we can read it better, also when you refer to the variable in the next page it is named $_GET['variable_name']... (PHP parses all variables in that array that are passed via url.) Explain more what is not working and someone might help...