<?php
include 'dbconnection.php';
$value = $_POST['value'];
$sql = "SELECT * FROM users WHERE id='$value' INNER JOIN address ON users.address_id = address.id";
$results = mysqli_query($conn, $sql);
if(mysqli_num_rows($results) > 0)
{
while($row = mysqli_fetch_array($results))
{
?>
<a>Details for: <?php echo $row['Email'];?></a><br>
<a>Address line 1: <?php echo $row['line1'];?></a><br>
<a>Address line 2:<?php echo $row['line2'];?></a><br>
<a>City: <?php echo $row['city'];?></a><br>
<a>County: <?php echo $row['county'];?></a><br>
<a>Postcode: <?php echo $row['postcode'];?></a><br>
<a>Country: <?php echo $row['country'];?></a><br><br>
<?php
}
}
?>
我试图允许管理员从表用户查看用户的详细信息,然后在表地址中显示外键数据,所有这一切都应该通过输入来完成,这些输入将存储到$价值变量。我可以让表中的每个用户一次显示但不是特定的一个。我错过了什么?