ParseError:语法错误,意外' =>' (T_DOUBLE_ARROW),期待','或者')'行号:89

时间:2018-06-18 06:01:27

标签: php codeigniter

我的代码出了什么问题?

例外:

  

遇到未捕获的异常   输入:ParseError   消息:语法错误,意外' =>' (T_DOUBLE_ARROW),期待','或者')'   文件名:C:\ xampp \ htdocs \ project_ci \ pariwisataapp \ application \ controllers \ Wisata.php   行号:89

示例代码:

function tambah_aksi(){
        $this->load->library('upload');
        $nmfile = "file_".time();
        $config['upload_path'] = './assets/images/wisata';
        $config['allowed_types'] = 'gif|jpg|png|jpeg|bmp';
        $config['max_size'] = '4048';
        $config['max_width'] = '6238';
        $config['max_height'] = '3288';
        $config['file_name'] = $nmfile;

        $this->upload->initialize($config);


        $id_jenis_wisata = $this->input->post('id_jenis_wisata');
        $id_kabupaten = $this->input->post('id_kabupaten');
        $nama_wisata = $this->input->post('nama_wisata');
        $harga_tiket = $this->input->post('harga_tiket');
        $jam_buka = $this->input->post('jam_buka');
        $jam_tutup = $this->input->post('jam_tutup');
        $alamat = $this->input->post('alamat');
        $no_telp = $this->input->post('no_telp');
        $no_wa = $this->input->post('no_wa');
        $instagram = $this->input->post('instagram');
        $facebook = $this->input->post('facebook');
        $twitter = $this->input->post('twitter');
        $email = $this->input->post('email');
        $website = $this->input->post('website');
        $foto = $this->input->post('foto');
        $video = $this->input->post('video');
        $keterangan = $this->input->post('keterangan');

        if($_FILES['filefoto']['name']){
            if($this->upload->do_upload('filefoto')){
                $gbr  = $this->upload->data();
                $data = $array(
                    'id_jenis_wisata' => $id_jenis_wisata, //line 89
                    'id_kabupaten' => $id_kabupaten,
                    'nama_wisata' => $nama_wisata,
                    'harga_tiket' => $harga_tiket,
                    'jam_buka' => $jam_buka,
                    'jam_tutup' => $jam_tutup,
                    'alamat' => $alamat,
                    'no_telp' => $no_telp,
                    'no_wa' => $no_wa,
                    'instagram' => $instagram,
                    'facebook' => $facebook,
                    'twitter' => $twitter,
                    'email' => $email,
                    'website' => $website,
                    'foto' => $gbr['file_name'],
                    'video' => $video,
                    'keterangan' => $keterangan
                );
            $this->m_wisata->input_wisata($data, 'tb_nama_wisata');
            $this->session->set_flashdata("pesan", "<div class='col-md-12'\><div class='\alert alert-success\' id='alert'>Upload gambar berhasil !!<div></div>");
                redirect('wisata');
            }else{
                $this->session->set_flashdata("pesan", "<div class='col-md-12'\><div class='\alert alert-success\' id='alert'>Gagal upload gambar !!<div></div>");
                redirect('wisata/tambah');
            }
        }

    }

0 个答案:

没有答案