Welcome Guest, Not a member yet? Register   Sign In
Message: Array to string conversion
#1

(This post was last modified: 07-13-2020, 12:52 AM by jreklund.)

Please Help Me, Why this data c'not post ini database :

PHP Code:
       $this->load->library('upload'$config);
        if ( ! $this->upload->do_upload('upload_old'))
        {
                $error = array('error' => $this->upload->display_errors());

                print_r($error);
        }
        else
        {
            $data['foto_old'] = $this->upload->data("file_name");
        }

$tracking['foto_old'] = $data;    //THIS PROBLEM
$this->db->trans_start();
$this->db->insert('ticket'$data);
$this->db->insert('tracking'$tracking); 
Reply
#2

As the error states $data are an array, and the query builder can only insert a string.

PHP Code:
$tracking['foto_old'] = $data['foto_old']; 
Reply




Theme © iAndrew 2016 - Forum software by © MyBB