将输入字段放在表格行中

时间:2017-07-19 16:17:13

标签: php html mysql

这是一个微不足道的问题,但是如何在php脚本中回显的表行中放置一个复选框。目前我收到的错误

这是代码

echo "<table>
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Coalition</th>
<th>Email</th>
<th>Select</th>
</tr>";
while($row = mysqli_fetch_array($result)) {
    echo "<tr>";
    echo "<td>" . $row['firstname'] . "</td>";
    echo "<td>" . $row['lastname'] . "</td>";
    echo "<td>" . $row['coalition'] . "</td>";
    echo "<td>" . $row['email'] . "</td>";
    echo "<td><input type="checkbox" name ="selected[]" value="<?php echo $row['id'];?>"/></td>";
    echo "</tr>";
}
echo "</table>";

错误: 解析错误:语法错误,意外'&lt;'在第45行的C:\ wamp \ www \ Voting \ includes \ list.inc.php中(此行是复选框)

0 个答案:

没有答案