php mysqli_next_result,php mysqli_next_result()函数

定义

mysqli_next_result()函数从mysqli_multi_query()准备下一个结果集。

语法

面向对象的风格:

bool mysqli::next_result ( void )

程序风格:

bool mysqli_next_result ( mysqli $link )

参数

参数

是否必须

描述

link

需要。

MySQL连接使用

返回值

成功返回TRUE,失败返回FALSE。

实例

以下代码使用mysqli_next_result()函数准备下一个结果集。

// http://www.manongjc.com/article/1684.html

// 作者:码农教程

$con=mysqli_connect("localhost","my_user","my_password","my_db");

if (mysqli_connect_errno($con)){

echo "Failed to connect to MySQL: " . mysqli_connect_error();

}

$sql = "SELECT name FROM emp;SELECT Country FROM emp";

if (mysqli_multi_query($con,$sql)){

do{

// Store first result set

if ($result=mysqli_store_result($con)){

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

print $row[0];

print "\n";

}

}

}while (mysqli_next_result($con));

}

mysqli_close($con);

?>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值