这条线的作用/目的是什么:
$db->next_result();
如果我删除该行,我会得到相同的输出/结果。
<?php
$mysqli = new mysqli("localhost", "user", "pass", "db");
/* check connection */
if ($mysqli->connect_errno) {
printf("Connect failed: %s\n", $mysqli->connect_error);
exit();
}
if ($result=$mysqli->query("SELECT * FROM `users`")) {
printf("Successfully queried.\n");
}
if($result){
while ($row=$result->fetch_object()){
print_r($row);
}
// Free result set
$result->close();
$db->next_result();
}
else echo($db->error);
$mysqli->close();
?>