为了账号安全,请及时绑定邮箱和手机立即绑定

这个总是报:Strict Standards: 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 E:\phpStudy\WWW\ceshi\mysqli.php on line 113

public function fetch_more_sql($table1, $table2)

{

$sql  = "SELECT * FROM ".$table1." LIMIT 1; SELECT * FROM ".$table2." LIMIT 1";

if(mysqli_multi_query($this ->db_connect(), $sql))

{

do{

//存储第一个结果集

if($result = mysqli_store_result($this ->db_connect() ))

{

while($row = mysqli_fetch_row($result)){

foreach ($row as $key => $value) {

echo $key;

}

}


mysqli_free_result($result);

}


} while( mysqli_next_result( $this ->db_connect()) && mysqli_more_results($this ->db_connect()) );


}

// print_r($rows);

}



正在回答

1 回答

入过我没看过的话,你用的一次只能执行一次SQL语句但是你执行了2条。$sql  = "SELECT * FROM ".$table1." LIMIT 1; SELECT * FROM ".$table2." LIMIT 1";

,第二不要动态拼装SQL语句,慎防SQL注入,和自己拼写错误,应该用预处理语句,然后绑定参数试试

0 回复 有任何疑惑可以回复我~
#1

和你一起闪耀到世界尽头

好吧,我的确看错了
2016-09-10 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

这个总是报:Strict Standards: 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 E:\phpStudy\WWW\ceshi\mysqli.php on line 113

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信