The mysqli_query() method will be returning an object resource to your $result variable, not a string value.
You have to loop it up and then access the records. Because you directly can not use it as your $result variable.
while ($row = $result->fetch_assoc()) {
echo $row['classtype']."<br>";
}
Want to know more about SQL ? Join this SQL Certification course by Intellipaat.