如何回顯列的名稱?我能夠選擇和迴應內容(TD),但我不知道如何「加載價值」。我的意思是動態加載MySql數據庫。如何回顯列的名稱
我想要從數據庫eee中的td的相同位置「加載值」。我想顯示字段名稱:id,a,b,c
<table>
<tr>
<th><input class="gris" type="text" name="a" value="load value"/></td>
<th><input class="gris" type="text" name="b" value="load value"/></td>
<th><input class="gris" type="text" name="c" value="load value"/></td>
<th><input class="gris" type="text" name="d" value="load value"/></td>
</tr>
<?php
$result = mysql_query("SELECT * FROM eee");
while($row = mysql_fetch_array($result)) {
?>
<tr>
<td> <input class="blanc" type="text" name="num" value="<?php echo $row['id']?>"/> </td>
<td><input class="blanc" type="text" name="primer" value="<?php echo $row['a']?>"/></td>
<td><input class="blanc" type="text" name="segon" value="<?php echo $row['b']?>"/></td>
<td><input class="blanc" type="text" name="segon" value="<?php echo $row['c']?>"/></td>
</tr>
<?php } ?>
</table>
從哪裏得到這個「負載值」 – Sibu
你想顯示字段的名稱? – GBD
你也可以使用'mysql_field_name()' – GBD