Object of class mysqli_result could not be converted to string
mysqli, php
Solution
The `mysqli_query()` method returns an object resource to your `$result` variable, not a string.
You need to loop it up and then access the records. You just can't directly use it as your `$result` variable.
while ($row = $result->fetch_assoc()) {
echo $row['classtype']."<br>";
}
Problem
I am getting the error: Object of class mysqli_result could not be converted to string This is my code: ``` $result = mysqli_query($con, "SELECT classtype FROM learn_users WHERE username='abcde'"); echo "my result <a href='data/$result.php'>My account</a>"; ```