![]() |
Script problem - 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: Script problem (/showthread.php?tid=15993) |
Script problem - El Forum - 02-21-2009 [eluser]macleodjb[/eluser] Hi guys, i have this upload script that i've created and i'm having a problem with it and don't know why. I've checked all the keys to see if they are incorrect and they are all fine. Code: function update_company($id) { my problem is that it will show that the information has been updated successfully, but when you go to the database it hasnt' changed. Is there a problem with using the post variables nested within htmlspecialchars() function? or is there another problem with this? Script problem - El Forum - 02-21-2009 [eluser]TheFuzzy0ne[/eluser] You're not actually updating the data. You're just checking for affected rows. You'll need to use $this->db->query() to run the query, and then $this->db->affected_rows() to get the affected rows. $this->db->affected_rows() doesn't accept any parameters. Hope this helps. Script problem - El Forum - 02-21-2009 [eluser]macleodjb[/eluser] Thanks for that. Script problem - El Forum - 02-21-2009 [eluser]TheFuzzy0ne[/eluser] Oh, and in case you're wondering, $this->db->affected_rows() is passing back the number of affected rows from the last database query. ![]() Code: function update_company($id) { Script problem - El Forum - 02-21-2009 [eluser]macleodjb[/eluser] thanks again, it's hard looking at too much code for too long. it seems the little things slip past you. Script problem - El Forum - 02-21-2009 [eluser]TheFuzzy0ne[/eluser] I agree. A pair of fresh eyes never hurts. You wouldn't believe how much pain some silly little typos have caused me. For example, typing: Code: if ($something = TRUE) Hehe. |