开发者

Any way to get the amount of rows returned using mysqli prepared statements?

Wondering if there is a way to get the amount of rows returned from a query using mysqli prepared statem开发者_C百科ents, sort of like

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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜