<?php
$host="localhost";
$user="root";
$pass="rooter";
$db="TestDB";
// Connect to the MySQL database
$conn = new mysqli($host, $user, $pass, $db);

// Check the connection
if ($conn->connect_error) {
    die("Connection failed: ".$conn->connect_error);
}

// Query the table
$sql = "SELECT * FROM Person";
$result = $conn->query($sql);
//$Grade = 'U';
// Display the results
if ($result->num_rows > 0) {
    echo "<h2>Person Table</h2><table border='1'><tr><th>ID</th><th>Name</th><th>Grade</th></tr>";
    while ($row = $result->fetch_assoc()) {
        
        echo "<tr><td>".$row["ID"]."</td><td>".$row["Name"]."</td><td>".$row["Grade"]."</td></tr>";
    
    }
    echo "</table>";
} else {
    echo "No records found.";
}

$conn->close();
?>