1
我试图从SQL查询中显示多行数据。我能够构建引用,以便表目前显示一行,但想知道如何使用相同的表结构显示所有行。PHP/HTML返回Oracle数据库中的所有行查询
<?php
include('connect.php');
oci_execute($sql);
while ($row = oci_fetch_array ($sql)) {
$pt = $row[0];
$eas = $row[1];
$shd = $row[2];
$epc = $row[3];
$tpc = $row[4];
$uid = $row[5];
}
?>
使用下面
<table class="table" id="aut">
<tr>
<th>Pt</th>
<th>Eas</th>
<th>Cs</th>
<th>Or</th>
<th>Pr</th>
<th>Ct?</th>
<th>Al</th>
</tr>
<tr>
<td><input type="text" name="Pt" value="<?php echo $pt; ?>" class="form-control" readonly=""></td>
<td><input type="text" name="Eas" value="<?php echo $eas; ?>" class="form-control" readonly=""></td>
<td><input type="text" name="Cs" value="<?php echo $tpc; ?>" class="form-control" readonly=""></td>
<td><input type="text" name="Or" value="<?php echo $shd; ?>" class="form-control" readonly=""></td>
<td><input type="text" name="Pr" value="<?php echo $usd; ?>" class="form-control" readonly=""></td>
<td><input type="text" name="Al" value="<?php echo $epc; ?>" class="form-control" disabled></td>
</tr>
</table>
这工作,从查询中获取剩余的行谢谢。 –
我之前做错了,尝试更新的代码。 – Phiter