我有一个循环,可以在带有单选按钮的表格中显示文档。选择后,我希望它显示数据的重置。现在,当我单击单选按钮时,它只会显示文档的第一行,如何让我的开关在单选值之间切换。
<?php
while( $row1 = mysql_fetch_array($myQ1) )
{
echo "<td><input type='radio' name='tog' id='tog' onClick='gtdoc()' value='$row1[2]'>$row1[3]</input></td></tr>";
$tog = $row1[2]; $ObjIndex = $tog[$i];
}
for ($i = 0; $i <= $tog; $i++)
{
if($tog[$i] != '0')
{
switch ($ObjIndex[$i])
{
case $tog:
echo $row1[3];
break;
}
}
}
$myQ9 = mysql_query("SELECT `iDocuments`.`File`.`FileIndex`, `iDocuments`.`File`.`FileName`, `iDocuments`.`Object`.`ObjectIndex`, `iDocuments`.`Object`.`ObjectName`, `iDocuments`.`Version`.`Version`, `iDocuments`.`File`.`UploadDate` FROM `iDocuments`.`Version` INNER JOIN `iDocuments`.`Object` ON `iDocuments`.`Object`.`ObjectIndex` = `iDocuments`.`Version`.`ObjectIndex` JOIN `iDocuments`.`File` ON `iDocuments`.`Version`.`FileIndex` = `iDocuments`.`File`.`FileIndex` WHERE `Object`.`ObjectStatus` = '1' AND `Version`.`Version` = ( SELECT MAX(`Version`) FROM `iDocuments`.`Version` WHERE `Version`.`ObjectIndex` = `Object`.`ObjectIndex` ) AND `Object`.`ObjectIndex` = '$ObjIndex'");
if (!$myQ9)
{
echo 'Could not run query 9: ' . mysql_error();
}
else
{
$row9 = mysql_query($myQ9);
}
while( $row9 = mysql_fetch_array($myQ9) )
{
echo "<table name='doclist'>
<tr><td>FileID</td><td><input name='DocFileID' type='text' readonly='true' value='$row9[0]'></input></td></tr>
<tr><td>File Name</td><td><input name='DocFileName' type='text' readonly='true' value='$row9[1]'></input></td></tr>
<tr><td>ObjectID</td><td><input name='DocID' type='text' readonly='true' value='$row9[2]'></input></td></tr>
<tr><td>Object Name</td><td><input name='DocName' type='text' readonly='true' value='$row9[3]'></input></td></tr>
<tr><td>Current Version</td><td><input name='CurrVer' type='text' readonly='true' value='$row9[4]'></input></td></tr>
<tr><td>Update Date</td><td><input name='lstupdate' type='text' readonly='true' value='$row9[5]'></input></td> </tr>
</table>";
}
?>