Ошибка PHP и MySQL: объект класса mysqli_result не может быть преобразован в строку
Я получаю ошибку:
Object of class mysqli_result could not be converted to string.
Код:
<?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.
?>
Как правильно это сделать?