Hi guys,
Can you check this code and see if there is something that is preventing the table from being populated?
<?php include("header.php"); ?> <?php $con=mysqli_connect("localhost","username","password","databasename"); if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); }$query = "SELECT * FROM 'teacher'";
$result = mysqli_query($con, $query);
echo "<div align=\"center\">";
echo "<table width=\"100%\">";
echo "<tr>";
echo "<th>First Name</th>";
echo "<th>Middle Name</th>";
echo "<th>Last Name</th>";
echo "</tr>";
while ($row = mysqli_fetch_array($result))
{
echo "<tr>";
echo "</td><td>";
echo $row['first_name'];
echo "</td><td>";
echo $row['middle_name'];
echo "</td><td>";
echo $row['last_name'];
echo "</td></tr>";
}
echo "</table>";
mysqli_free_result($result);
mysqli_close($con);
?>
</div>