• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Message: Array to string conversion

#1
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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.