列の名前をエコーする方法は?コンテンツ(td)を選択してエコーすることはできましたが、thで「値をロード」する方法がわかりません。MySqlデータベースから動的にロードすることを意味します。
tdと同じ場所から、データベースeeeから「値をロード」したいと思います。フィールド名を表示したい: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>