[英]Any way to get the amount of rows returned using mysqli prepared statements?
想知道是否有一种方法可以使用mysqli准备好的语句从查询返回的行数,类似于
mysql_num_rows($query);
Presuming you're doing something like: 假设您正在执行以下操作:
$result = $statement->execute();
You can get the number of rows with 您可以通过获取行数
$result->num_rows;
See the manual . 请参阅手册 。
Use this code: 使用此代码:
$result = $mysqli->query($query);
$num_rows = $result->num_rows($result);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.