我正在编写一个查询来检查一列以查看它的值是否为 0,然后在表中列出所有发现。数据由 5 列和 140 行可能的数据组成。
每当我加载此页面时,加载需要 8 - 10 秒,然后给我一个错误,说网页错误导致 IE 关闭并重新打开页面。知道什么可能导致此错误或加载时间过长吗?
<?php
include 'login.php';
$con=mysqli_connect($host,$user,$password,$db);
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result = mysqli_query($con,"SELECT * FROM Persons");
echo "<table border='1'>
<tr>
<th>Firstname</th>
<th>Lastname</th>
</tr>";
while($row = mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['FirstName'] . "</td>";
echo "<td>" . $row['LastName'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysqli_close($con);
?>