Help needed with multi upload, extra text fields and database - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Help needed with multi upload, extra text fields and database (/showthread.php?tid=43773) |
Help needed with multi upload, extra text fields and database - El Forum - 07-22-2011 [eluser]StefanAlexandru[/eluser] Hi again everyone, I do know that this question have been asked million times before, but I just can't find way to make this thing work. So this is the scenario : I am building a classified ad site, and I need to be able to make a form with 3 images and a few other fields with information and than to store the information in to the database. After searching more than 3 hours on google I've finally decided to ask you guys for a good workaround. The below controller code has been taken also from this forum, but I need somehow to make this code to also insert the other fields into the database, not only the images. Controller : Code: <?php The real problem with this controller is that if I am trying to insert also the text field information when I am inserting the images, because it's in the foreach loop, it will insert the information 3 times. I just can't find the logic to this operation correct. My ads table is looking like this : id title content someotherfield1 someotherfield2 image1 image2 image3 If there is any tutorial already posted somewhere please point me to it, because as I said above, I've searched for a workaround for more than 3 hours, and I was not successful. Thanks in advance and sorry for my bad english. |