错误导致页面关闭并重新打开 - PHP / HTML

I'm writing a query that checks a column to see if it has a value of 0 and then list all of the findings in a table. The data consist of 5 columns and 140 rows of possible data.

Whenever I load this page it takes 8 - 10 seconds to load and then gives me an error saying that an error with the webpage cause IE to close and reopen the page. Any idea what could be causing this error or the long load time?

<?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);
?> 

It looks like you might not be establishing your connection correctly.

This line -

$con-mysqli_connect($host,$user,$password,$db);

appears that you are trying to connect to the database, but is incorrectly written as a variable.

Also judging by your mysqli_close($con) statement, it's clear to me that you meant to assign $con to the connection.

Try,

$con = mysqli_connect($host, $user, $password, $db);