0

I'm trying to create User Update profile page, everything is fine change made by User is stored on database, but when redirect to user profile got error on line number 59.

Here is my code.

Controller

function update_profile($id){
 $where = array('id' => $id);
 $data['tb_user'] = $this->Model_user->edit_data($where,'tb_user')->result();
 $this->load->view('user/user_eprofile',$data);
}

function save_profile(){
 $id = $this->input->post('id');
 $nama = $this->input->post('nama');
 $alamat = $this->input->post('alamat');
 $email = $this->input->post('email');
 $nohp = $this->input->post('nohp');



$data = array(


  'nama' => $nama,
  'alamat' => $alamat,
  'email'=>$email,
   'nohp'=>$nohp,


);

$where = array(
 'id' => $id
);

$this->Model_user->update_data($where,$data,'tb_user');
 $this->session->set_flashdata('msg','<div class="alert alert-info"><i class="fas fa-info-circle"></i> Perubahan Tersimpan.</div>');
redirect('user/user_profile');
}

User View

<div class="logoarea pt-5 pb-5">
          <p>
            <center><img src="<?php echo base_url('assets/img/user.svg')?>" style="width:175px"></center>
          </p>

          <hr style="border-color:#ffffff;margin-top:30px;margin-bottom:30px">
          <h5 style="letter-spacing:3px"><b>PROFILE SAYA</b></h5>
          <?php echo $this->session->userdata('nama') ?>


          <br>
          <br>


---------- GOT ERROR ON THIS LINE AFTER SAVING USER DATA


          <a class="btn btn-outline-white btn-md btn-round" href="<?php echo site_url('user/user_profile/update_profile/'.$user->id);?>" style="font-size:12px;letter-spacing:2px"><i class="fas fa-user-edit" style="margin-right:10px"></i> UPDATE PROFILE</a>


----------


          <?php echo $this->session->flashdata('msg'); ?>
        </div>

0 Answers0