如何添加 link 来编辑和删除使用 php 制定的 table 中的每一行

How to add a link to edit and delete each row in a table formulated using php

我写了 php 输出 php table 的代码,对于每一行,我希望能够在编辑和删除中添加一个额外的列 link(增删改查功能)。目前我已经能够添加额外的列,但我不确定如何在每一行中实际添加编辑和更新 links。我的 table 目前看起来像这样。 [1]: https://i.stack.imgur.com/nwFzQ.png

table 是使用 html 代码制作的,数据是使用 php 代码接收的,该代码被 link 编辑到另一个文件。以下是html代码,

      <table class="content-table">
    <thead>
        <tr>
          <th>Cashflow</th>
          <th>Amount</th>
          <th>Description</th>
          <th colspan="2">Action</th>
        </tr>
      </thead>
      <tbody>
        <?php include_once('data.php'); ?>

      </tbody>
  </table>

以下是php代码(data.php):

      while ($data = mysqli_fetch_assoc($output)) {
    echo "<tr><td>". $data["cashflow"] ."</td><td>". $data["amount"] ."</td><td>". $data["description"] ;
  }

您需要来自数据库示例的一些 ID:$data["id"]

    while ($data = mysqli_fetch_assoc($output)) {
    echo "<tr>";
    echo "<td>". $data["cashflow"] ."</td>";
    echo "<td>". $data["amount"] ."</td>";
    echo "<td>". $data["description"]."</td>";
    echo '<td><a href="URL TO EDIT?id='.$data["id"].'">Edit</a></td>';
  }