Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../quiz.css" rel="stylesheet" type="text/css">
<title>Administrator Approval</title>
</head>
<body>
<br><h2><div class=head1>User Approval</div></h2>
<table width="75%" align="center" bordercolor="#000000" cellpadding="5px"border="1">
<tr>
<th scope="col">Select </th>
<th scope="col">User Id </th>
<th scope="col">Login </th>
<th scope="col">Password </th>
<th scope="col">Username </th>
<th scope="col">Address </th>
<th scope="col">City </th>
<th scope="col">Phone </th>
<th scope="col">Email </th>
</tr>
<?php
extract($_POST);
$query=mysql_query('select * from approval');
while($row=mysql_fetch_array($query)){
echo"<tr>";
echo"<form action='approve.php' method='post'>";
echo"<td align='center'><input type='checkbox' name='approve' value='$row[0]'>  </td>";
echo"<td align='center'>$row[0] </td>
<td align='center'>$row[1] </td>
<td align='center'>$row[2] </td>
<td align='center'>$row[3] </td>
<td align='center'>$row[4] </td>
<td align='center'>$row[5] </td>
<td align='center'>$row[6] </td>
<td align='center'>$row[7] </td>
</tr>";
}
echo"<td colspan='9' align='center'><input type='submit' name='submit' value='Approve'></td>";
echo"</table>";
echo"</form>";
?>
</body>
</html>
上面的(不完整的)文件是供管理员批准学生帐户的。正如您所见,从批准表中选择的条目已添加到用户表中,但user_id(即行 [0])可以是多个,因为我提供了复选框。我想在单个“提交”任何建议时将该用户 ID 的(多个)数据插入到用户表中?