【发布时间】:2016-06-23 05:40:12
【问题描述】:
我有一个动态表(打印 DB 中特定组的一些学生的姓名),对于每个学生,我都有一个复选框,我必须在其中选择标记。我需要有关如何为多个插入多个标记的帮助mysql的同学????
我必须插入标记的数据库表是这样的: 身份证姓名标记
以及html和php的代码
<form>
<table >
<thead >
<tr>
<th>Nr</th>
<th>Name_Surname</th>
<th>Mark</th>
</tr>
</thead>
<tbody>
<?php
$query = "select student.name from student where student.group = '2' " ;
$run=mysql_query($query);
$d=1;
while ($row=mysql_fetch_assoc($run))
{
?>
<tr>
<th ><?php echo $d++; ?>
</th>
<td>
<input type="text" name= "name" value = '<?php echo $row["name"];?> '>
</td>
<td>
<fieldset >
<label for="mark"></label>
<select name="mark" >
<option>-</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
</select>
</fieldset>
</td>
</tr>
<?php } ?>
</tbody>
</table>
<button type="submit" name="save" >Printo</button>
</form>
【问题讨论】: