本文介绍了codeigniter:$查询 - > free_result()采用活动记录什么时候?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

后,我已经完成了我的结果来自于codeigniter模型中的活动记录查询设置,我应该使用$查询 - > free_result()还是ActiveRecord的自动做到这一点?

after i have finished with my result set from a active record query in a codeigniter model, should i use $query->free_result() or does activerecord automatically do that?

推荐答案

PHP将清理一切你的脚本完成后。但是,如果你有很多,比方说,一个循环查询,结果不会每次迭代后清理。​​

PHP will clean up everything after your script is done. However, if you have lots of queries in, say, a loop, the results will not be cleaned up after each iteration.

所以,如果你在一个循环中运行大量的查询,你可能会想free_result()来清除内存。否则,它是没有必要的。看到这里的细节:

So, if you run lots of queries in a loop, you probably will want to free_result() to clear up memory. Otherwise, it's not necessary. See here for details:

http://ellislab.com/$c$cigniter/用户指南/数据库/ results.html

这篇关于codeigniter:$查询 - > free_result()采用活动记录什么时候?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 11:35