【发布时间】:2018-07-10 20:49:10
【问题描述】:
我正在尝试使用复选框来更新 MySQL 数据库中的信息。
“已发送”列是一个布尔值。
有没有办法在我的 php 代码中放置一个复选框,tbody 所以,而不是 <td>".$infoItems['Sent']."</td> 有一个复选框而不是零。
<table class="scroll">
<thead>
<tr>
<th>Schools Name</th>
<th>Schools Email</th>
<th>Sent</th>
</tr>
</thead>
<tbody>
<?php
$execItems = $conn->query("SELECT Name,SchoolMail,Sent FROM Schools");
while($infoItems = $execItems->fetch_array())
{
echo "
<tr>
<td>".$infoItems['Name']."</td>
<td>".$infoItems['SchoolMail']."</td>
<td>".$infoItems['Sent']."</td>
/* ^Insert a checkbox here instead of this ^ */
</tr>
";
}
?>
</tbody>
</table>
</body>
</html>
【问题讨论】:
-
什么复选框和什么更新?你没试过吗?
-
这是两个不同的问题吗...?
-
<input type=checkbox...>等等?