php - 如何将复选框添加到行结果

标签 php mysql

我错过了什么 得到

Parse error: syntax error, unexpected 'checkbox' (T_STRING), expecting ',' or ';' in C:\xampp\htdocs\index.php on line 70

  if(mysql_num_rows($result) !== 0)
            {
            while($row=mysql_fetch_array($result))
                {
                echo '<tr>
                <td>'.$row['aid'].'</td>
                <td>'.$row['Name'].'</td>
                <td>'."<input type="checkbox" class='form' value="1" name="checkbox[]" />".'</td>
                </tr>';
                }
            }

最佳答案

更正此行

<td>'."<input type="checkbox" class='form' value="1" name="checkbox[]" />".'</td>

像这样

<td>'."<input type='checkbox' class='form' value='1' name='checkbox[]' />".'</td>

关于php - 如何将复选框添加到行结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23355590/

相关文章:

mysql - 特殊字符和简单的选择查询

php - 如何逐步设置和使用 phpDocumentor

php - wordpress 中的自定义导航栏。如何正确设置样式?

php - 访问 joomla 3 中的自定义字段

php - Joomla 3 : manually updating a table in the database

mysql - Sphinx 搜索查询 - varchar 列中数字的条件

php - 使用 php 为移动应用程序(如 android、ios)动态编码 json 中的数据

php - 添加特殊字符时正则表达式匹配失败

PHP 在单个文件中连接到 MySQL 和 MSSQL

mysql - Sails.JS + MySQL : Unknown column 'NaN' in 'where clause'