php pdo 免费结果

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6084396/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 23:18:37  来源:igfitidea点击:

pdo free result

phpmysqlpdo

提问by Timo Huovinen

there is a mysql function in php called mysql_free_result(); I couln't find any similar function for PDO.

php中有一个mysql函数叫做mysql_free_result();我找不到 PDO 的任何类似功能。

is there a pdo function to free the result of a database fetch or does the result set automatically get requested and freed when I call $stmt->fetch()data?

是否有一个 pdo 函数来释放数据库获取的结果,或者在我调用$stmt->fetch()数据时是否会自动请求并释放结果集?

could someone explain me this difference between native mysql and pdo?

有人可以向我解释一下本机 mysql 和 pdo 之间的区别吗?

采纳答案by dqhendricks

closest method is close cursor for PDO statements.

最接近的方法是关闭 PDO 语句的游标。

http://us.php.net/manual/en/pdostatement.closecursor.php

http://us.php.net/manual/en/pdostatement.closecursor.php

回答by Stijn Leenknegt

You can set the object variable to null. The GC will destroy the PDO Statement instance, I guess.

您可以将对象变量设置为 null。我猜 GC 会破坏 PDO Statement 实例。