Postingan lainnya
Buku Ini Koding!
Baru!
Buku ini akan jadi teman perjalanan kamu belajar sampai dapat kerjaan di dunia programming!
array to string coversion
ini kenapa array to string conversion ya?
bagian path $detail2
ini error nya
A PHP Error was encountered
Severity: Notice
Message: Array to string conversion
Filename: controllers/site.php
Line Number: 508
public function do_upload()
{
$is_logged_in = $this->session->userdata('is_logged_in');
$type = $this->session->userdata('type');
if(!isset($is_logged_in) || $is_logged_in != true)
{
$data['error'] = 'YOU MUST SIGN IN FIRST!';
$data ['tag']= 'login';
$data['main_content'] = 'login';
$this->load->view('include/users_template', $data);
}
else
{
$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'docx|pdf';
$config['max_size'] = 20000;
$this->load->library('upload', $config);
if ( ! $this->upload->do_upload('userfile')) {
$error = array('error' => $this->upload->display_errors());
$data['error'] = $this->upload->display_errors();
$data ['tag']= 'printaskusers';
$data['main_content'] = 'printaskusers';
$this->load->view('include/users_template', $data);
}
else {
$data = array('upload_data' => $this->upload->data());
$this->load->model('createorder_model');
$this->load->model('konfirmasi_model');
$this->load->model('penetapanharga_model');
$count = $this->createorder_model->countorder();
$detail = array(
'order_id' => date('Ym').'0'.$count+1,
'customer_id' => $this->session->userdata('pID'),
'notes' => $this->input->post('notes'),
'total_page' => $this->input->post('totalpage'),
'color_page' => $this->input->post('colorpage'),
'black_page' => $this->input->post('blackpage'),
'delivery_cost' => $this->input->post('deliverycost'),
'total_payment' => $this->input->post('totalpayment'),
'latitude' => $this->input->post('latitude'),
'longitude' => $this->input->post('longitude'),
'referral' => $this->input->post('usereferral'),
'order_status' => 1,
'cover_type' => $this->input->post('covertype'),
'order_type' => $this->input->post('ordertype'),
'payment_type' => $this->input->post('paymenttype'),
'address' => $this->input->post('alamatantar'),
'created_at' => date('Y-m-d H:i:m'),
'updated_at' => date('Y-m-d H:i:m')
);
$detail2 = array(
'name' => $this->upload->data('file_name'),
'path' => 'uploads/'.$this->upload->data('file_name'),
'order_id' => date('Ym').'0'.$count+1,
'created_at' => date('Y-m-d H:i:m'),
'updated_at' => date('Y-m-d H:i:m')
);
$this->createorder_model->create_file('file', $detail2);
$this->createorder_model->create_order($detail);
$data['rows'] = $this->konfirmasi_model->ConfirmviewAllCover();
$data['rows2'] = $this->konfirmasi_model->ConfirmviewAllOrderType();
$data['rows3'] = $this->konfirmasi_model->ConfirmviewAllPayment();
$data['rows4'] = $this->konfirmasi_model->ConfirmviewAllOrder();
$data['rows5'] = $this->penetapanharga_model->RincianHarga();
$data['rows6'] = $this->konfirmasi_model->UploadFile();
$data['error'] = 'You have created an order';
$data ['tag']= 'konfirmasiorder';
$data['main_content'] = 'konfirmasiorder';
$this->load->view('include/users_template', $data);
0
1 Jawaban:
Yang line 508 yang mana gan? Yang jelas, agan itu punya data berupa array.
Dan agan ga bisa begitu saja mereturn array ke dalam bentuk string. .
Contoh, agan ga bisa langsung meg echo $array, sblm $array diubah kedalam bentuk string
0