Fatal error: Cannot use object of type mysqli_result

Cannot use object of type mysqli_result as array

Use mysqli_fetch_assoc or mysqli_fetch_array to fetch a result row as an associative array.

$query = "SELECT 1";
$result = $mysqli->query($query);
$followingdata = $result->fetch_assoc()

or

$followingdata = $result->fetch_array(MYSQLI_ASSOC);

Leave a Comment