douqiao2008 2016-09-14 04:44
浏览 231

如何在HTML表的每一行上添加编辑按钮[关闭]

(That's it. I don't know how to add edit button under "edit column" of each row.) Please suggest me any solution for this problem.

enter link description here
http://localhost/test/logindetails.php?edit=Modify#
enter code here

<?php
// making connection

$conn=mysqli_connect('localhost','root','') ;

// selecting database

    mysqli_select_db($conn,"company") ;
    $sql= "SELECT * FROM login" ;
    $records=mysqli_query($conn,$sql) ;
?> 
<html>
    <head>
        </script>
        <title>Details!!!!</title>
    </head>
    <body>
        &#9824;
        <h2>Details!!!!!!!!!</h2>
        <div>
            <table width="600" border="1" cellpadding="1" cellspacing="1">
                <tr>
                    <th>Id</th>
                    <th>Username</th>
                    <th>Password</th>
                    <th>Edit</th>
                </tr>
        </div>
    <?php
        while($std = mysqli_fetch_array($records)) 
        {
            echo "<tr>";
            echo "<td>" . $std['id'] . "</td>";
            echo "<td>" . $std['username'] . "</td>";
            echo "<td>" . $std['password'] . "</td>";
            echo "<td>" . $std['Edit'] . "</td>";
            echo "</tr>";
        }
    ?>
        </table>
    </body>
</html>
  • 写回答

3条回答 默认 最新

  • douji0588 2016-09-14 04:48
    关注

    If there is no database connection then use :

    <table>
    <tbody>
    <?php for($i=0;$i<11;$i++){?>
    <tr><td><input type="submit" value="submit"/></td></tr>
    <?php } ?>
    </table>
    

    It will print a table with 10 rows and all the td contains a button.

    评论

报告相同问题?

悬赏问题

  • ¥50 三种调度算法报错 采用的你的方案
  • ¥15 关于#python#的问题,请各位专家解答!
  • ¥15 对于这个问题的解释说明
  • ¥200 询问:python实现大地主题正反算的程序设计,有偿
  • ¥15 smptlib使用465端口发送邮件失败
  • ¥200 总是报错,能帮助用python实现程序实现高斯正反算吗?有偿
  • ¥15 对于squad数据集的基于bert模型的微调
  • ¥15 为什么我运行这个网络会出现以下报错?CRNN神经网络
  • ¥20 steam下载游戏占用内存
  • ¥15 CST保存项目时失败