Can someone explain how I would output the result of the sql below? currently getting \'Object of class mysqli_result could not be converted to string\'.
$sq
Use any of mysqli_fetch_*()
functions (or in OOP style: $result->fetch_*()
) to retrieve the results from the mysqli_results object ($results).
See mysqli_result documentation on the various methods and their uses.
because you try to use echo
to print object, and it used to print string only, you should use:
print_f($result);
instead of
echo ($result);
Error because you are echoing an object, so try like this,
while($res = mysqli_fetch_array( $result )) {
echo $res['AverageSatisfactionScore'];
}