Welcome Guest, Not a member yet? Register   Sign In
[solved] uploaded image saved twice
#1

[eluser]livewirerules[/eluser]
Im trying to upload an image and save the image path in the database to retrieve and display. But when i upload the image is saved twice in the folder.

below is the code to my controller

Code:
if ( !$this->upload->do_upload('image'))
            {
        $error = array('error' => $this->upload->display_errors());
        $this->load->view('upload_success', $error);
      
        
            }
        

        else {
                $image=$this->upload->do_upload('image');
            $username=$this->session->userdata('username');
            
            $data =array(
            'submitedby'=>$username,
            'type'=>$this->input->post('qtype'),
            'for'=>$this->input->post('manager'),
            'image' => $image['full_path']
        
    );    
            
            
            $this->load->model('member_functions');

            $query=$this->member_functions->insert($data);



can someone please tell me what am i doing wrong?




Theme © iAndrew 2016 - Forum software by © MyBB