Welcome Guest, Not a member yet? Register   Sign In
update image
#1

[eluser]anyamanggar[/eluser]
hi guys, i have a lilte problem in update image file. The Case is when i want to update image i have finish upload but evertything id what i post is same with other, please help me..

Code:
function editgambarberita() {
        if ($_FILES) {
        
  $config = array(
  'upload_path' => 'images/uploads/berita/',
        'allowed_types' => 'gif|jpeg|jpg|png',
        'max_size' => '5120' // 5MB
  );

        $this->load->library('upload', $config);
        $this->upload->initialize($config);
  if ($this->upload->do_upload()) {
        $data = array(
        'upload_data' => $this->upload->data()
        );
                
        $file_name = $data['upload_data']['file_name'];
        $save['img_path'] = $file_name;}
        $this->load->model('news_model');
        $this->news_model->updategbr($save['file_name']);
  }
      if($_POST != NULL) {
        redirect('news_admin');
        }
  $this->load->view('admin/gantigambarberita_view');
  }

my model

Code:
function updategbr($data) {
       $this->db->update('news',$data);
    }


Messages In This Thread
update image - by El Forum - 07-09-2012, 08:44 PM
update image - by El Forum - 07-09-2012, 10:08 PM
update image - by El Forum - 07-09-2012, 10:15 PM
update image - by El Forum - 07-09-2012, 11:32 PM
update image - by El Forum - 07-10-2012, 09:36 PM



Theme © iAndrew 2016 - Forum software by © MyBB