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