存储后我是否必须释放mysql结果? [英] Do I've to free mysql result after storing it?

查看:54
本文介绍了存储后我是否必须释放mysql结果?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否将$stmt->free_result()的结果存储在$stmt->store_result()之后是否要调用$stmt->free_result()?我可不可以只打电话给$stmt->close()最后?

I was wondering whether or not I've to call the $stmt->free_result() for after I've stored it's result with $stmt->store_result()? Could I rather just call $stmt->close() on the end?

之所以这么问,是因为当我呼叫$stmt->num_rows时,我必须按如下所示呼叫$stmt->store_result(): http://www.php.net/manual/en/mysqli-stmt.store-result.php .

The reason why I'm asking it is because when I call the $stmt->num_rows I've to call the $stmt->store_result() as said here: http://www.php.net/manual/en/mysqli-stmt.num-rows.php, but they don't call the $stmt->free_result() in their example. However, on the $stmt->store_result() they do: http://www.php.net/manual/en/mysqli-stmt.store-result.php.

推荐答案

您没有没有明确释放结果,但是如果愿意,可以这样做.否则,当语句句柄超出范围时,结果将被释放.

You do not have to expressly free the result, but you can if you'd wish. If you don't, the result will be freed when the statement handle goes out of scope.

这篇关于存储后我是否必须释放mysql结果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆