代码
<form name="form1" method="post" action="update.php">
<table width="790" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="12"><div align="center"><img src="image/xx.jpg" width="790" height="130"></div></td>
</tr>
<tr>
<td height="30" colspan="12" class="top style1"><div align="left"><a href="admin.php">返回</a> | <a href="<?php echo $FF_Logout ?>">退出登陆</a></div></td>
</tr>
<tr>
<td height="1" colspan="12"><hr></td>
</tr>
<tr>
<td height="30" colspan="12" class="top style1"><div align="left">学号为<span class="style12"><?php echo $row_name['a_name']; ?></span>的学生的选课情况</div></td>
</tr>
<tr class="index_font">
<td width="107" height="20"><div align="center"><span class="style1">学号</span></div></td>
<td width="98" height="20"><div align="center"><span class="style7">年度</span></div></td>
<td width="71" height="20"><div align="center"><span class="style7">学期</span></div></td>
<td width="42" height="20"><div align="center"><span class="style7">班次</span></div></td>
<td width="230" height="20"><div align="center"><span class="style7">课程名称</span></div></td>
<td width="51" height="20"><div align="center"><span class="style7">成绩</span></div></td>
<td width="51" height="20"><div align="center"><span class="style7">学时</span></div></td>
<td width="51" height="20"><div align="center"><span class="style7">学分</span></div></td>
<td width="75" height="20"><div align="center"><span class="style7">开课单位</span></div></td>
<td width="76" height="20"><div align="center"><span class="style7">所属类别</span></div></td>
<td width="38" height="20"> </td>
<td width="44" height="20"> </td>
</tr>
<?php $bgcolor="#fff9e8";
do {if($bgcolor=="#fff9e8")$bgcolor="#F0FFFF";
else $bgcolor="#fff9e8"; ?>
<tr bgcolor="<?php echo $bgcolor;?>">
<td height="20"><?php echo $row_name['a_name']; ?></td>
<td height="20"><?php echo $row_name['term']; ?></td>
<td height="20"><?php echo $row_name['updown']; ?></td>
<td height="20"><?php echo $row_name['class']; ?></td>
<td width="150" height="20"><?php echo $row_name['subject']; ?></td>
<td height="20"><input name="cj" type="text" id="cj" value="<?php echo $row_name['cj']; ?>" size="3"></td>
<td height="20"><?php echo $row_name['classtime']; ?></td>
<td height="20"><?php echo $row_name['fen']; ?></td>
<td width="130" height="20"><?php echo $row_name['unit']; ?></td>
<td width="150" height="20"><?php echo $row_name['lei']; ?></td>
<td height="20"><input name="a_id" type="hidden" id="a_id" value="<?php echo $row_name['a_id']; ?>">
<input name="a_name" type="hidden" id="a_name" value="<?php echo $row_name['a_name']; ?>">
</td>
<td height="20"><input type="submit" name="Submit" value="更新"></td>
</tr>
<?php } while ($row_name = mysql_fetch_assoc($name)); ?>
</table>
</form>
更新页面如下
<?php require_once('Connections/xuanke.php');
mysql_select_db($database_xuanke,$xuanke);
echo $a=$_POST['a_id'];
echo $b=$_POST['a_name'];
echo $c=$_POST['cj'];
$updatecommand="update admin set cj='$c' where a_id='$a'";
mysql_query($updatecommand,$xuanke);
header("location:admincheckname.php?a_name='$b'");
?>