upload form with extra information in it - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: upload form with extra information in it (/showthread.php?tid=37418) |
upload form with extra information in it - El Forum - 01-09-2011 [eluser]Dizza[/eluser] Hi all, At the moment i can upload an image and store the path/name to my database. But im stuck with something else. I am trying to add some extra fields to the upload form, like name, description and ingredients. I did the form oke, but it doesnt seem to upload the data from the fields into the database. Here is my view, controller and model! View Code: <?php echo form_open_multipart('upload/do_upload');?> Controller Code: function do_upload() And the model Code: function save_image($image_name = '', $data) At the moment i just have some random data to be stored in the database. But i think i need to do something with making variables from the "voorgerecht, beschrijving and afbeelding" Am i right? Grtz and thanks! upload form with extra information in it - El Forum - 01-09-2011 [eluser]jpijper[/eluser] You're not passing $data to save_image? upload form with extra information in it - El Forum - 01-09-2011 [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()); Model Code: function save_image($image_name = '') |