[eluser]Dizza[/eluser]
[quote author="jpijper" date="1294621980"]You're not passing $data to save_image?[/quote]
Thanks for your feedback!
I now edited this line
Code:
$this->upload_model->save_image($file_name);
to
Code:
$this->upload_model->save_image($file_name, $data);
but it still inserts nothing except the imagename to the database..
thx
EDIT:Already solved it lol, how could i be so stupid! Thanks for the reply jpijper
For the people who need this solution to, its simple:
Controller:
Code:
$data = array('upload_data' => $this->upload->data());
echo "Het nieuwe gerecht is geupload";
$img_data = $this->upload->data();
$file_name = $img_data['file_name'];
$this->load->model('upload_model');
$this->upload_model->save_image($file_name);
Model
Code:
function save_image($image_name = '')
{
$this->db->insert('voorgerecht',array(
'naam' => $this->input->post('naam'),
'beschrijving' => $this->input->post('beschrijving'),
'ingredienten' => $this->input->post('ingredienten'),
'afbeelding'=>$image_name
));