I'm trying to take some values form the database and I tried the code like this
$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");
}
But it showing some error as Call to a member function result() on a non-object