通过php从mysql提取数据,为什么显示结果不是表格形式
<body><table><tr><th>order</th><th>order</th><th>order</th><th>order</th></tr><?php$d...
<body>
<table>
<tr>
<th>order</th><th>order</th><th>order</th><th>order</th>
</tr>
<?php
$db = mysql_connect("localhost","root","") or die("error");mysql_select_db("test") or die("error");
$sql = "select * from `record`";
$a=mysql_query($sql,$db);
$row=mysql_num_rows($a);
if ($row>0)
{
$b=mysql_result($a,$index,"order");
$c=mysql_result($a,$index,"card");
$d=mysql_result($a,$index,"location");
$e=mysql_result($a,$index,"time");
}
?>
<tr>
<td><?php echo $b ?></td>
<td><?php echo $c ?></td>
<td><?php echo $d ?></td>
<td><?php echo $e ?></td>
</tr>
</table>
</body> 展开
<table>
<tr>
<th>order</th><th>order</th><th>order</th><th>order</th>
</tr>
<?php
$db = mysql_connect("localhost","root","") or die("error");mysql_select_db("test") or die("error");
$sql = "select * from `record`";
$a=mysql_query($sql,$db);
$row=mysql_num_rows($a);
if ($row>0)
{
$b=mysql_result($a,$index,"order");
$c=mysql_result($a,$index,"card");
$d=mysql_result($a,$index,"location");
$e=mysql_result($a,$index,"time");
}
?>
<tr>
<td><?php echo $b ?></td>
<td><?php echo $c ?></td>
<td><?php echo $d ?></td>
<td><?php echo $e ?></td>
</tr>
</table>
</body> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询