Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/253.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 输入引导可编辑表的数据发送到数据库_Javascript_Php_Html_Bootstrap 4 - Fatal编程技术网

Javascript 输入引导可编辑表的数据发送到数据库

Javascript 输入引导可编辑表的数据发送到数据库,javascript,php,html,bootstrap-4,Javascript,Php,Html,Bootstrap 4,我有一个带添加、编辑和删除选项的引导可编辑表。我建立了一个PHP连接,以便从数据库中获取表中的数据 我想添加一个选项,当输入数据或编辑或删除行时,这些更改也会发生在数据库中,而不仅仅是在网站上 <table class="table table-bordered table-striped table-hover table-condensed text-center" id="DyanmicTable"> <tr>

我有一个带添加、编辑和删除选项的引导可编辑表。我建立了一个PHP连接,以便从数据库中获取表中的数据

我想添加一个选项,当输入数据或编辑或删除行时,这些更改也会发生在数据库中,而不仅仅是在网站上

<table class="table table-bordered table-striped table-hover table-condensed  text-center" id="DyanmicTable">
    <tr>
      <th>row 1</th>
      <th>row 2</th>
      <th>row 3</th>
      <th>row 4</th>
      <th>row 5</th>
      <th class="text-center">
      <button id="addNewRow" class="btn btn-primary btn-sm">Add New Row</button>
    </tr>
    <?php
    while($rows=mysqli_fetch_assoc($result))
    {
    ?>
    <tr>
      <td><?php echo $rows['row 1'] ?></td>
      <td><?php echo $rows['row 2'] ?></td>
      <td><?php echo $rows['row 3'] ?></td>
      <td><?php echo $rows['row 4'] ?></td>
      <td><?php echo $rows['row 5'] ?></td>
    </tr>
    <?php
    }
    ?>
  </table>

第1行
第2排
第3排
第4排
第5行
添加新行

这是我正在使用的表。

到目前为止,您尝试了什么来达到您的预期结果?我尝试了到处搜索,然后删除,主要是因为大多数代码太复杂,我无法理解和编辑,无法使其正常工作。我建议您开始阅读
ajax
。,在这里你可以找到一个例子谢谢大家的回答。我将尝试更好地重新表述我的问题:我有三个按钮,一个用于添加,一个用于编辑,一个用于删除。我希望每个按钮都能完成它的功能。