我正在尝试以有序的方式显示我的所有表格行
database table = u_visits
rows = id/ip_adress/visits/dates
这是我的代码:
<html>
<body>
<?php
include 'includes/connect3.php';
$result = mysqli_query($con,"SELECT * FROM u_visits");
$num = mysqli_num_rows($result);
?>
<table border="0" cellspacing="2" cellpadding="2">
<tr>
<td>
<font face="Arial, Helvetica, sans-serif">Value1</font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif">Value2</font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif">Value3</font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif">Value4</font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif">Value5</font>
</td>
</tr>
<?php
$i=0;
while ($i < $num) {
$f1 = mysqli_result($result,$i,"id");
$f2 = mysqli_result($result,$i,"ip_adress");
$f3 = mysqli_result($result,$i,"visits");
$f4 = mysqli_result($result,$i,"dates");
?>
<tr>
<td>
<font face="Arial, Helvetica, sans-serif"><?php echo $f1; ?></font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif"><?php echo $f2; ?></font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif"><?php echo $f3; ?></font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif"><?php echo $f4; ?></font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif"><?php echo $f5; ?></font>
</td>
</tr>
<?php$i++;}
?>
</body>
</html>
提前感谢您的所有帮助!如果这不是我想要完成的事情的方法,我愿意接受新的建议,再次感谢。