海。我知道有类似的答案,但我无法得到它。这是我的鳕鱼:
<?php include 'header.php'; ?>
<?php include 'connect.php';
$q = mysqli_query($link, $aaa = 'SELECT * FROM agentii LEFT JOIN orase ON agentii.oras=orase.oras_id WHERE orase.oras_id = \'' .$_GET['id']. '\'') or die(mysqli_error($link));
$row = mysqli_fetch_assoc($q);
?>
<h2>Title <em><?php echo $row['oras'];?></em></h2>
<div class="div_view">
<table cellspacing="0" cellpadding="5" border="0" width="100%">
<tr>
<th>Agentie</th>
<th>Adresa</th>
</tr>
<?php while ($row = mysqli_fetch_assoc($q)) { ?>
<tr>
<td><?php echo $row['agentie'];?></td>
<td><?php echo $row['adresa'];?></td>
</tr>
<?php }?>
</table>
</div>
<?php include 'footer.php'; ?>
这个输出(我不能放图像,因为是一个新帐户 - 所以我放了一个指向 prt src 的链接): http: //postimage.org/image/w9zsexz91/
在我的数据库中,我有 3 行,代码只输出 2 行。我知道这是因为 2 mysqli_fetch_assoc,但我想显示所有行,并且我也想<?php echo $row['oras'];?>
在 while 之外显示标题()。
有人可以帮我吗?提前谢谢!