Error in variable when looping

From: Date: Tue, 14 Jan 2003 00:21:40 +0000
Subject: Error in variable when looping
Groups: php.general 
Request: Send a blank email to php-general+get-131489@lists.php.net to get a copy of this message
Hello friends, I have made the following table of data and a button on every row to view the details. The code is working fine and the table is displayed with the buttons. The problem I have is that the $SelectedItemNumber posted to the next page remains the same number no matter which row button I click. I have my relevant code below. Please help me. I know I am making a mistake somewhere but I cannot figure out where. Quote : while($row=mysql_fetch_array($result)){ Print " <tr> "; Print "<td width=\"12%\" align=\"center\" height=\"6\" bgcolor=\"#FFFFbf\"><font face=\"Tahoma\" color=\"#000000\">" ; Print "<b> <font size=\"2\" color=\"ff0000\"> $row[OrgName] </b></font>"; print "</font> &nbsp;</td>"; Print "<td width=\"12%\" align=\"center\" height=\"6\" bgcolor=\"#FFFFbf\"><font size=\"2\" face=\"Tahoma\" color=\"#000000\">" ; Print $row[OrgCountry]; print "</font> &nbsp;</td>"; Print "<td width=\"12%\" align=\"center\" height=\"6\" bgcolor=\"#FFFFbf\"><font size=\"2\" face=\"Tahoma\" color=\"#000000\">" ; Print $row[OrgNumber]; print "</font> &nbsp;</td>"; Print "<td width=\"12%\" align=\"center\" height=\"6\" bgcolor=\"#FFFFbf\"><font size=\"2\" face=\"Tahoma\" color=\"#000000\">" ; Print $row[Orgaddress]; print "</font> &nbsp;</td>"; Print "<td width=\"12%\" align=\"center\" height=\"6\" bgcolor=\"#FFFFbf\"><font size=\"2\" face=\"Tahoma\" color=\"#000000\">" ; Print $row[OrgChief]; print "</font> &nbsp;</td>"; Print "<td width=\"12%\" align=\"center\" height=\"6\" bgcolor=\"#b7b700\"><font size=\"2\" face=\"Tahoma\" color=\"#000000\">" ; Print"<INPUT TYPE=\"submit\" value=\"View details\" Name=\"Details\">"; print "</td>"; Print"<input type=\"hidden\" name=\"SelectedItemNumber\" value= $row[Id]"; Print "</tr>";} } ?> Unquote Thanks Denis

« previous php.general (#131489) next »