我收到错误消息:
mysqli_result 类的对象无法转换为字符串。
代码:
<?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.
?>
这样做的正确方法是什么?