In my program, I want to fetch the data from the database from different tables and compare them with each other but it only shows registered as the strings are not equal.
<?php
$id = $_SESSION["teacher_id"];
$sql1 = "SELECT sem FROM students_data where mentor='$id'";
$sql2 = "SELECT sem FROM teacher where teacher_id='$id'";
($result1 = mysqli_query($db, $sql1)) or die(mysqli_error());
($result2 = mysqli_query($db, $sql2)) or die(mysqli_error());
if ($result1 == $result2) {
echo "Registered";
} else {
echo "Not Registered";
}
?>