看了一堆例子。没发生什么事。我尝试转移到输入元素的ID 的值。数据库中用于后续删除记录的行标识符。但无论我如何尝试,Get 都不会从 id 属性中获取此值
<?php
require_once("dbcontroller.php");
$db_handle = new DBController();
$sql = "SELECT * from main";
$faq = $db_handle->runQuery($sql);
?>
<table class="one">
<thead>
<tr>
<th class="table-header" width="10%">№</th>
<th class="table-header">Дата</th>
<th class="table-header">Адрес</th>
<th class="table-header" width="10%">Наименование проекта</th>
<th class="table-header">Что изменено</th>
<th class="table-header">Кем</th>
<th class="table-header">Документ</th>
</tr>
</thead>
<tbody>
<?php
foreach($faq as $k=>$v) {
?>
<tr class="table-row">
<td><?php echo $k+1; ?></td>
<td contenteditable="true" onBlur="saveToDatabase(this,'destination','<?php echo $faq[$k]["id"]; ?>')" onClick="showEdit(this);"><?php echo $faq[$k]["destination"]; ?></td>
<td contenteditable="true" onBlur="saveToDatabase(this,'name_change','<?php echo $faq[$k]["id"]; ?>')" onClick="showEdit(this);"><?php echo $faq[$k]["name_change"]; ?></td>
<td contenteditable="true" onBlur="saveToDatabase(this,'changee','<?php echo $faq[$k]["id"]; ?>')" onClick="showEdit(this);"><?php echo $faq[$k]["changee"]; ?></td>
<td contenteditable="true" onBlur="saveToDatabase(this,'date_change','<?php echo $faq[$k]["id"]; ?>')" onClick="showEdit(this);"><?php echo $faq[$k]["date_change"]; ?></td>
<td contenteditable="true" onBlur="saveToDatabase(this,'moderator','<?php echo $faq[$k]["id"]; ?>')" onClick="showEdit(this);"><?php echo $faq[$k]["moderator"]; ?></td>
心有法竹