How to access result set data passed from the model through the controller to the view in CodeIgniter
06:36 30 Oct 2017

I am writing code for displaying data from mysql db to front end. I am using CodeIgniter for this. I am not able to find correct way to solve my error.

This is my controller:

load->model('Menu_items_model');
    }

    public function index()
    {
        $query = $this->Menu_items_model->get_items();
        $data['EMPLOYEES'] = null;
        if ($query) {
            $data['EMPLOYEES'] =  $query;
        }
        $this->load->view('layouts/sidebar.php', $data);
    }
}
?>

My Model:

db->select("MENU_ID,MENU_DISPLAY");
        $this->db->from('app_menu_items');
        $query = $this->db->get();
        return $query ->result(); 
    }
}
?>

my view where I got this error:


        
  • MENU_ID; ?>
  • MENU_DISPLAY; ?>
  • } else { echo 'record not found';
    php codeigniter model-view-controller codeigniter-3 resultset