PHP ID undefined



>我在PHP表中未定义的ID有问题。

<div class="header"> 
<h2 style="font-family: Heebo;padding: 25px;">Blog posts lists</h2>
</div>
<?php $results = mysqli_query($db, "SELECT Title, Date FROM posts");?>
<table>
<thead>
<tr>
<th>Title</th>
<th>Date</th>
<th colspan="2">Action</th>
</tr>
</thead>
<form action="" method="post">
<?php while ($row = mysqli_fetch_array($results)) { ?>
<tr>    
<td><input name='id' id='id' value='".$id."' type='hidden'></td>
<td><?php echo $row['Title']; ?></td>
<td><?php echo $row['Date']; ?></td>
<td>
<a href="edit.php?edit=<?php echo $row['id']; ?>" class="fa fa-pencil" </a>
</td>
<td>`enter code here`
<a href="index.php?edit=<?php echo $row["id"]; ?>" class="fa fa-globe"</a>
</td>
<td> 
<a href="configDB.php?id=<?php echo $row['id']; ?>" onclick="return confirm('Are you sure?')" class="fa fa-trash" </a>
</td>
</tr>
<?php 
} ?>
</table>
</form>
</div>
</body>
</html>

无论我做什么 id 都无法识别,甚至在 url 中都没有被识别。

我尝试添加isset函数,但仍然没有。 ConfigDB 是查询所在的地方,我已经在那里声明了变量 $id=0; 此 ConfigDB 包含在 index.html 文件中。

更改

<?php $results = mysqli_query($db, "SELECT Title, Date FROM posts");?>

<?php $results = mysqli_query($db, "SELECT id, Title, Date FROM posts");?>

相关内容

最新更新