Undefined offset: 0 error is happening in my edit data form after submitting. Sometimes this works and most of the time it doesnt. any idea where the mistake is happening?
function data_user_edit($id = ''){
$user = $this->adminmodel->selectdata('user where id_user = "'.$id.'"')->result_array();
$data = array(
'title' => '.:: EVALUASI PROSES BELAJAR MENGAJAR GURU SMA NEGERI 4 BEKASI::. ',
'titlesistem' => $this->model->getTitle(),
'nama' => $user[0]["nama"],
'id_user' => $user[0]["id_user"],
'status' => 'edit',
'username' => $user[0]["username"],
'password' => $user[0]["password"],
'level' => $user[0]["level"],
'tipeakun' => $user[0]["tipeakun"],
);
$this->load->view('admin/header',$data);
$this->load->view('admin/data_user_form');
$this->load->view('admin/footer');