-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) –