【发布时间】:2012-12-07 00:04:29
【问题描述】:
在我的模型中,我有这个 sn-p
$this->db->select('*');
$this->db->from('User');
$this->db->where('email', $mail);
$query = $this->db->get();
return $query;
据我所知,$query 是一个数组(一组结果),我想检索该数组中某个字段的特定值以将其返回或将其分配给另一个变量,问题是如何?
我想做这样的事情
$value = $query['first_field_of_resultset'];
return $value;
【问题讨论】:
-
$query实际上有一个CI_DB_mysql_result对象,您可以在该对象上调用方法来返回结果,结果存储在result_object属性中。 -
我该如何使用它的方法?
标签: php mysql codeigniter activerecord