【发布时间】:2013-05-06 14:03:52
【问题描述】:
我同时使用result() 和result_array()。
通常我喜欢将结果作为数组获取,这就是我主要使用 result_array() 的原因..
但我想知道我应该遵循哪种更好的方法, 就性能而言,哪一个更有效?
这是我在 codeigniter 查询中讨论的示例
$query = $this->db->get();
$result = $query->result_array();
或者这应该是更好的方法??
$query = $this->db->get();
$result = $query->result();
我现在也在我的通用模型中使用 result_array。
【问题讨论】:
标签: php codeigniter