我可以使用哪个函数来检查结果数组中是否存在值? 我尝试了以下方式,但失败了。
$query = $this->db->query($query);
$result = $query->result_array();
if (in_array('Receive', $result)) {
echo 'this array contains Receive';
}
答案 0 :(得分:0)
尝试这个
echo $this->db->last_query();
它将显示您执行的最后一个查询。只需将它放在功能的最后。
编辑:
抱歉,我以为你问的是查询,我的不好。但是,如果您想知道查询是否以数组形式返回值,则可以使用:
$result = $query->result_array();
print_r($result);