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>";
}
More Related Contents:
- Object of class mysqli_result could not be converted to string
- SELECT COUNT(*) AS count – How to use this count
- Mysqli update throwing Call to a member function bind_param() error [duplicate]
- mysqli bind_param() expected to be a reference, value given
- Should I manually check for errors when calling “mysqli_stmt_prepare”?
- mysqli_real_escape_string() expects exactly 2 parameters, 1 given
- SSL operation failed with code 1: dh key too small
- Can’t pass mysqli connection in session in php
- PHP Fatal error: Call to undefined function mysqli_stmt_get_result()
- how to bind multiple parameters to MySQLi query [closed]
- mysqli ignoring the first row in a table
- Returning Multiple Rows with MySqli and Arrays
- mySQLi prepared statement unable to get_result()
- mysqli_select_db() expects parameter 1 to be mysqli, string given
- What does the mysqli_error() expects parameter 1 to be mysqli, null given mean?
- Mysqli prepared statement column with variable [duplicate]
- What to do with mysqli problems? Errors like mysqli_fetch_array(): Argument #1 must be of type mysqli_result and such
- Fatal error: Uncaught exception ‘mysqli_sql_exception’ with message ‘No index used in query/prepared statement’
- How to fetch all in assoc array from a prepared statement?
- Fatal error: Call to undefined function mysqli_result()
- Fatal error: Call to undefined method mysqli_stmt::fetch_array() [duplicate]
- Why I am getting an error when using w3school tutorial? [duplicate]
- Using wildcards in prepared statement
- How to remove the fatal error when fetching an assoc array
- Fatal error: Call to undefined method mysqli_stmt::get_result()
- Call to undefined method mysqli_result::fetch()
- Which is fastest in PHP- MySQL or MySQLi?
- prepared parameterized query with PDO
- How to make mysqli connect function?
- Check to see if an email is already in the database using prepared statements