![]() |
$this->db->update() --- returning errors - 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: $this->db->update() --- returning errors (/showthread.php?tid=10860) |
$this->db->update() --- returning errors - El Forum - 08-15-2008 [eluser]Dan Bowling[/eluser] I don't see on the user guide how to determine problems when using $this->db->update(). If there is a problem, how do I know what it is? Right now I'm using this code for my controller: Code: function update($id, $column) and this for the model: Code: function update($column, $value, $id) The value sometimes doesn't update, and for the life of me, I can't figure out why. I'm sure you can tell I'm pretty new at this by my code. Any feedback to help me learn is greatly appreciated. $this->db->update() --- returning errors - El Forum - 08-15-2008 [eluser]m4rw3r[/eluser] Try setting your log_threshold to 4, then check the log. If that doesn't help you, check $this->db->affected_rows() and the return of update(). Also check $this->db->last_query(). $this->db->update() --- returning errors - El Forum - 08-15-2008 [eluser]Frychiko[/eluser] Add this line of code to the controller: Code: $this->output->enable_profiler(TRUE); It outputs varies things to the screen (post variables, sql queries etc.) Then you can see the sql queries on your screen to see exactly what is going on. You can cut and paste that and plug it into phpmyadmin to find out exactly what went wrong. $this->db->update() --- returning errors - El Forum - 08-18-2008 [eluser]Dan Bowling[/eluser] Thanks! Those commands are very helpful! |