MySQLi_more_results 的定义和使用方法
下面一起来了解下MySQLi_more_results 的定义和使用方法,相信大家看完肯定会受益匪浅,文字在精不在多,希望MySQLi_more_results 的定义和使用方法这篇短内容是你想要的。
版本支持mysqli_more_results(mysqli$link)
检查上一次调用mysqli_multi_query()函数之后, 是否还有更多的查询结果集。
参数如果上一次调用mysqli_multi_query()函数之后, 还有更多的结果集可以读取,返回 TRUE,否则返回 FALSE。
示例<?php$link=mysqli_connect("localhost","my_user","my_password","world");/*检查连接*/if(mysqli_connect_errno()){printf("Connectfailed:%s\n",mysqli_connect_error());exit();}$query="SELECTCURRENT_USER();";$query.="SELECTNameFROMCityORDERBYIDLIMIT20,5";/*批量执行查询*/if(mysqli_multi_query($link,$query)){do{/*storefirstresultset*/if($result=mysqli_store_result($link)){while($row=mysqli_fetch_row($result)){printf("%s\n",$row[0]);}mysqli_free_result($result);}/*printdivider*/if(mysqli_more_results($link)){printf("-----------------\n");}}while(mysqli_next_result($link));}/*关闭连接*/mysqli_close($link);
相关函数mysqli_multi_query()- 执行查询
mysqli_next_result()- 为读取 multi_query 执行之后的下一个结果集做准备
mysqli_store_result()- 转移上一次查询返回的结果集
mysqli_use_result()- 启动结果集检索
看完MySQLi_more_results 的定义和使用方法这篇文章后,很多读者朋友肯定会想要了解更多的相关内容,如需获取更多的行业信息,可以关注我们的行业资讯栏目。
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。