【问题标题】:How to add a check box to a row result如何将复选框添加到行结果
【发布时间】:2014-04-29 12:48:34
【问题描述】:

我错过了什么 得到

解析错误:语法错误,意外的“复选框”(T_STRING),需要“,”或“;”在第 70 行的 C:\xampp\htdocs\index.php 中

  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>';
                }
            }

【问题讨论】:

    标签: php mysql


    【解决方案1】:

    更正这一行

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

    喜欢这个

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

    【讨论】:

      【解决方案2】:

      试试这个方法,

      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>';
                  }
              }
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2017-09-10
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-09-21
        • 2011-03-05
        • 1970-01-01
        相关资源
        最近更新 更多