0
私はそこに3行のデータが異なるテーブルを持っています。私は、HTMLテーブルに完全なデータベーステーブルを表示しようとしましたが、1つのデータを3回表示します。ここは、htmlテーブルのデータベーステーブルのすべてのデータを表示します
$query=mysqli_query($db,"SELECT entrydate,day,discription,highlight,place from datatable");
$insert=mysqli_fetch_array($query);
$countrow=mysqli_num_rows($query);
がテーブルを示すためのコードです...
<?php
If ($countrow > 0) {
for($i=0;$i<$countrow;$i++) {
?>
<tr>
<td><?php echo $insert['entrydate']; ?></td>
<td><?php echo $insert['day']; ?></td>
<td><?php echo $insert['discription']; ?></td>
<td><?php echo $insert['highlight']; ?></td>
<td><?php echo $insert['place']; ?></td>
<td>
<a href="#" class="btn btn-sm btn-primary glyphicon glyphicon-pencil"></a>
<a href="#" class=" btn btn-sm btn-danger glyphicon glyphicon-remove"></a>
</td>
</tr>
<?php
}
}
?>
私の出力は、あなたが削除する必要が output
ループのi変数を使用していません – Akintunde007
mysqli_fetch_array()は_inside_ループに属しています! – arkascha
ありがとう!!それは働いています... –