The SQL is correct because when I execute the SQL in phpMyAdmin it gives me the correct output. The code below always gives me the output 'instructor.' How can I solve this??
queryMysql($query) {
global $conn;
$result = $conn->query($query);
if (!$result) {
die($conn->error);
}
return $result;
}
$usertype = queryMysql("SELECT UserType FROM users WHERE Username='$user' AND Password='$pass'");
$student = 'Student';
$teacher = 'Teacher';
$instructor = 'Instructor';
if ($usertype === $student){
echo 'student';
} elseif ($usertype === $teacher) {
echo 'teacher';
} else {
echo 'instructor';
}