Php 如何将获取的id提供给其他元素?

Php 如何将获取的id提供给其他元素?,php,html,css,bootstrap-4,Php,Html,Css,Bootstrap 4,我正在尝试构建一个确认框,当smb尝试删除表记录时会出现该框。 问题是,确认框的链接总是采用第一个记录id,而不是我想要的记录id 以下是图片中的一个示例: 我使用while循环获取数据库的结果,并在index.php中使用函数显示表。。这就是为什么我在另一个文件中输出带有echo函数的表。。但是,我如何传输的ID为: 是否指向此按钮链接?: 以下是我从表中删除记录的方式: require 'inc/connect_db.php'; $id = $_GET['del']; $

我正在尝试构建一个确认框,当smb尝试删除表记录时会出现该框。 问题是,确认框的链接总是采用第一个记录id,而不是我想要的记录id

以下是图片中的一个示例:

我使用while循环获取数据库的结果,并在index.php中使用函数显示表。。这就是为什么我在另一个文件中输出带有echo函数的表。。但是,我如何传输的ID为:

是否指向此按钮链接?:

以下是我从表中删除记录的方式:

  require 'inc/connect_db.php';
  $id = $_GET['del'];
  $con->query("DELETE FROM eintraege WHERE id=$id") or die($con->error());
}```


as you can see from the pictures it always takes the first row of my table.. 



    echo "<tr>
                       <td>".$dec_row1."</td>

                       <td><p class='copyP' title='Klicken zum kopieren' onclick='copyTc($ipid)'>".$dec_row2."</p></td>

                       <td>".$dec_row3."</td>

                       <td style='width: 30%'><p title='Klicken zum kopieren' class='copyP' onclick='copyTc($pwid)'>".$dec_row4."</p></td>

                       <td style='white-space: nowrap'>

                          <span style='padding-right: 1em;'><button type='button' class='btn btn-primary btn-circle btn-mini'><i class='fas fa-info-circle'></i></button></span>

                        <a href='index.php?edTabinsrt_edrId=".$row['id']."' class='btn btn-warning btn-circle btn-mini'><i class='fas fa-marker'></i></a>

                       </td>
                       <td>

                       <a href='index.php?del=".$row['id']."' class='btn btn-danger btn-circle btn-mini' data-toggle='modal' data-target='#del_accept'><i class='far fa-trash-alt'></i></a>


                       <div class='modal fade' id='del_accept' tabindex='-1' role='dialog' aria-labelledby='modalCenterTitle' aria-hidden='true'>
                         <div class='modal-dialog modal-dialog-centered' role='document'>
                           <div class='modal-content'>
                             <div class='modal-header'>
                               <p style='color: rgb(128, 15, 15);margin: 0; padding: 0em;font-size: 1.5625em' class='modal-titl' id='accept_title'>Achtung!</p>
                               <button type='button' class='close' data-dismiss='modal' aria-label='Close'>
                                 <span aria-hidden='true'>&times;</span>
                               </button>
                             </div>
                             <div class='modal-body'>
                               <p style='font-size: 1em'>Sie sind im begriff den Datensatz aus der Datenbank zu löschen. Bestätigen Sie mit <b>Löschen</b> um fortzufahren</p>
                             </div>
                             <div class='modal-footer'>
                               <button type='button' class='btn btn-secondary' data-dismiss='modal'><i class='fas fa-times'></i> Abbrechen</button>
                               <a href='index.php?del=".$row['id']."' class='btn btn-danger' ><i class='far fa-trash-alt'></i> Löschen</a>
                             </div>
                           </div>
                         </div>
                       </div>

                        <!--<button type='button' class='btn btn-danger btn-circle btn-mini'><i class='fas fa-eraser'></i></button>-->
                       </td>
                     </tr>"; 

thank y'all.. 
require'inc/connect_db.php';
$id=$_GET['del'];
$con->query(“从eIntrage中删除,其中id=$id”)或die($con->error());
}```
从图片中可以看出,它总是占据我桌子的第一排。。
回声“
“$dec_row1。”

“$dec_row2。”

“$dec_row3。”

Achtung

&时代;

您现在开始使用Datensatz aus der Datenbank zuöschen。您最好是使用löschen um fortzufahren

取消 "; 谢谢大家。。
您没有正确分析问题。您创建的HTML代码中的链接对于
del
参数都有不同的值。但是你一直在看同一个第一模态。ID在HTML文档中必须是唯一的,但是您在多个地方违反了这一点,其中一个是模态元素的ID。因此,你的模态不能正常工作。谢谢你,我解决了它,非常感谢!!!