Strict Standards: mysqli::next_result()错误

php_way 2014-08-24 08:41:08
这是PHP手册上的例子 msyqli::multi_query
提示:Strict Standards: mysqli::next_result() [mysqli.next-result]: There is no next result set. Please, call mysqli_more_results()/mysqli::more_results() to check whether to call this function/method in D:\www\Apache2.2\htdocs\02PHP\index.php on line 25
<?php

$mysqli = @new mysqli('localhost', 'root', '123456', 'test');
if($mysqli->connect_errno){
die('connect database error: ' . $mysqli->connect_error);
}

$sql = "select current_user();";
$sql .= "select name from stu";

if($mysqli->multi_query($sql)){

do{
if($res = $mysqli->store_result()){
while($row = $res->fetch_row()){
printf('%s\n', $row[0]);
}
$res->free();
}

if($mysqli->more_results()){
printf("--------------\n");
}

}while($mysqli->next_result());


}

$mysqli->close();

?>

...全文
166 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
杰森-李 2016-06-17
  • 打赏
  • 举报
回复
}while($mysqli->more_results() && $mysqli->next_result());
php_way 2014-08-27
  • 打赏
  • 举报
回复
版主都到哪里了

56,677

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧