Problem with Image field emptying on editing - 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: Problem with Image field emptying on editing (/showthread.php?tid=43537) |
Problem with Image field emptying on editing - El Forum - 07-15-2011 [eluser]the_unforgiven[/eluser] Hi All, I have a system with admin area and when I go to edit an event it updates the DB with the details of the text area and input box but then removes the image that I previous uploaded via the add function. Add Event Function - This inserts all data including image correctly Code: function addEvent($post_data = null) Edit Code - This update the title and description but removes the image Code: function editEvent($id = null, $post_data = null) This is my save event function which does everything upon clicking the save button Code: function saveevent() I just wondered if any of you can help me has this data is stored in a array and therfore once it's edited it goes back to the save function and obviously there's nothin in the image field once doing an edit so therefore it inserts into the DB as a blank field for the image row within the database. Please help me Thanks in advance. Problem with Image field emptying on editing - El Forum - 07-15-2011 [eluser]brucebat[/eluser] So when you goto edit details there is no image right? It looks like there may be a problem with your Adminmodel file could you post the code? Problem with Image field emptying on editing - El Forum - 07-15-2011 [eluser]the_unforgiven[/eluser] It's ok after looking through the code i posted again I decided just for easy-ness I would create another function, which works a dream but thanks anyhow. Problem with Image field emptying on editing - El Forum - 07-15-2011 [eluser]brucebat[/eluser] Ok, Its just im going to be making an Admin area for my website and I am curious about what I would do for it so was wondering If i could spy on your code? =) Thanks Problem with Image field emptying on editing - El Forum - 07-15-2011 [eluser]the_unforgiven[/eluser] That is my admin model code so feel free to look at it |