XAMPP version is 7.0.4
Installation file type Application (exe)
Full name is xampp-win32-7.0.4-0-VC14-installer
My Operating System is Windows 10
64 bit Operating System/x64 processor
Home Edition
*Not sure where to find the service pack level
The installation path is C:\xampp\new_directory
I'm currently trying to make a navigation menu from one of my columns in my mysql table.
Okay, so in my PHP class Database file, I have this function:
public function get_food_type(){
return $this->query("SELECT food_type FROM menu");
}
And in the other file I have the following code:
<?php
require_once('Includes/wzDB.php');
$content = "<div id=\"menu\">"
. "<nav id=\"food\">"
. "<ul>"
. $type=wzDB::getInstance()->get_food_type();
print($type);
if($type->num_rows>0){
while($row = $type->fetch_assoc()){
echo "<li>" . htmlspecialchars($row['food_type']) . "</li>";
}
}
"</ul>"
. "</nav>"
. "</div>";
But when I try to run the file, I get the following error message
Catchable fatal error: Object of class mysqli_result could not be converted to string in C:\xampp\new_directory\htdocs\Wu_Zen2\menu.php on line 8
How do I fix this error?