PHP- und MySQL-Fehler: Objekt der Klasse mysqli_result konnte nicht in String konvertiert werden
Ich erhalte den Fehler:
Object of class mysqli_result could not be converted to string.
Code:
<?php
$con=mysqli_connect("78.46.51.231","root","","multicraft_daemon");
if (mysqli_connect_errno($con)){
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$sql = ("select sum(`memory`) from `server`;");
$result = mysqli_query($con, $sql);
echo $result; //$result is mysqli_result and can't be forced to string.
?>
Was ist der richtige Weg, um dies zu tun?