I used this existing question to help me out: HTML - Change\\Update page contents without refreshing\\reloading the page
The template-comparison.php file fetches the
$results = mysql_query("SELECT * FROM PresidentialCandidate WHERE ID='$ID'");
if( mysql_num_rows($results) > 0 )
{
$row = mysql_fetch_array( $results );
echo $row['ID'];
}
Replace with:
$sql = "SELECT * FROM PresidentialCandidate WHERE ID='$ID'";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
$row = $result->fetch_assoc();
echo $row['ID'];
}
Please don't mix both mysql_*
& mysqli_*
functions.