我有一个表,我正在从 MySQL 中提取数据。单击此表旁边的更新按钮,将出现一个新的弹出窗口,并且将使用数据输入表单。但由于表中行中的 id,我想将数据自动调用到表单中。我怎样才能获取这个id?
<tr>
<td> <?php echo $row['id']; ?> </td>
<td> <?php echo $row['username']; ?> </td>
<td> <?php echo $row['password']; ?> </td>
<td> <?php echo $row['number']; ?> </td>
<td> <?php echo $row['tarihilk']; ?> </td>
<td> <?php echo $row['tarihson']; ?> </td>
<td><a href="edit.php?id=$res[id]"> <i class=" fa fa-edit" style="font-size:24px"></i></a></td>
</tr>
另外,还有edit.php 文件。
<?php
include("config.php");
$id = $_GET['id'];
$result = mysqli_query($conn,"SELECT * from users WHERE id=$id");
while($row=mysqli_fetch_array($result)){
$username = $row['username'];
$password = $row['password'];
$number = $row['number'];
$tarihilk = $row['tarihilk'];
$tarihson = $row['tarihson'];
}
?>
眼眸繁星
森林海