[eluser]rijobo[/eluser]
I've got an upload function, which uploads a file and puts the info in the database. When I run this function, I get this error:
Parse error: syntax error, unexpected '[' in /usr/home/deb20206/domains/bijvoorbeeldzo.nl/public_html/simo-edelsmid/system/application/controllers/administrator.php on line 36
I expect, that is has got something to do with the $upload_data to the database. Can someone tell me, what I'm doing wrong?
This is my function:
function upload()
{
$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'png|gif|jpg';
$config['max_size'] = '10000';
$upload_veld = 'foto';
$this->load->library('upload', $config);
if($this->upload->do_upload($upload_veld)) {
$upload_data = $this->upload->data();
} else {
$data['error'] = $this->upload->display_errors();
}
$product = array('naam'=>$_POST['naam'], 'omschrijving'=>$_POST['omschrijving'], 'foto'=>$upload_data['file_name'], 'soort'=>$_POST['soort'], 'steen'=>$_POST['steen'], 'prijs'=>$_POST['prijs'], 'afmeting'=>$_POST['afmeting'], 'materiaal'=>['materiaal']);
$this->Productupload->insertRow('product', $product);
}