-2
我试图采取一些价值观形成的数据库运行选择查询,我试图这样调用一个成员函数结果()一个非对象在哪里codeingiter
$condition = ['restaurant_id' => $restaurant_id, 'menu_category_id' => $menu_category_id, 'current_template_id' => '0'];
$this->db->select('time_range');
$this->db->from('menu_category_timing_t');
$this->db->where($condition);
$query = $this->db->get();
$data = $query->result();
if ($data) {
print_r("data available")
}
else {
print_r("data is not available");
}
但它显示的代码一些误差呼叫一个成员函数的结果()非对象
可能重复[参考 - 这是什么错误在PHP中意味着什么?](http://stackoverflow.com/questions/12769982/reference-what-does-this-error-mean-in-php) –
可能的重复[调用成员函数结果()非对象codeigniter](http://stackoverflow.com/questions/22685990/call-to-member-function-result-of-non-object-codeigniter) –