sql only fires if there is a change in update form - 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: sql only fires if there is a change in update form (/showthread.php?tid=45803) |
sql only fires if there is a change in update form - El Forum - 10-06-2011 [eluser]joehopkins[/eluser] Hi, I'm having an issue with an update form. It's a 'client details' form where the fields are pre-populated with the data from the DB. Basically, the form only updates if you modify a text field, i.e. the text field submitted is a different value from before. If you don't do this, e.g. not change anything or merely select a checkbox the form sends the variables to the model but the model doesn't seem to execute the sql. After testing, I know the form is sending the data, and I know the model is receiving it. It's just that it doesn't seem to execute the query at all. affected_rows() is zero and it returns no errors. It's as if CI checks cross checks the fields before executing the SQL. But if you modify a text field it all works swimmingly-well. My code is massive so I'll post a summary: Controller: Code: if ($this->form_validation->run() == FALSE) Code: function update_client($title, |