douleng3463 2014-03-22 22:03
浏览 53

PHP,MYSQL和HTML FORMS不能一起工作

I have this code but when I press the submit button No data is being transferred via Get, with the exemption on the submit.

<table cellspacing="0px">
    <tr>
    <td>Name</td><td>Today - <?php echo $date;?></td>
    </tr>
    <form method="get" action="update_reg.php">
    <?php
    $result = mysqli_query($con,"SELECT * FROM TABLE WHERE GROUP = 'Penguins' ORDER BY Rank, Name ");
    while($row = mysqli_fetch_array($result))
      {
      echo "<tr>";
      echo "<td>";
      if($row['Rank'] == "a"){
        $rank = "TOP ";
      }
      if($row['Rank'] == "b"){
        $rank = "MIDDLE ";
      }
      if($row['Rank'] == "c"){
        $rank = "SECOND ";
      }
      if($row['Rank'] == "d"){
        $rank = "BOTTOM ";
      }
      if($row['Rank'] == "e"){
        $rank = "";
      }
      echo $rank . $row['Name'] . "</td>";
      $num = $num + 1;
      echo "<td><input type=\"text\" class=\"today\" id=\"" . $row['id'] . "\" data-number=\"" . $num . "\" size=\"1\" maxlength=\"1\"></td></tr>";
      }
    ?>
</table>
<input type="submit" value="submit">
</form>

For some reason this isn't working, anyone got any ideas why? Thanks in advance.

  • 写回答

3条回答 默认 最新

  • dsa45132 2014-03-22 22:05
    关注

    GROUP is a reserved keyword. So you need to backtick it as

    `GROUP`
    
    
    SELECT * FROM TABLE WHERE `GROUP` = 'Penguins' ORDER BY Rank, Name 
    

    UPDATE FROM LAST COMMENT

    Input need a name which is not there and if you give same name for all of them they will not work. So give a name="something[]" and on submit get the data as array

    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器