Affected-rows question - 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: Affected-rows question (/showthread.php?tid=16288) |
Affected-rows question - El Forum - 03-02-2009 [eluser]Las3r[/eluser] Hi there, I got the following function: Code: function submit_ticket($category,$title,$content) The query is executed properly, data gets written in the database, however the affected rows won't show properly (should 1, since its an insert statement). I tried changing: Code: if ($sql->affected_rows() == 1) Code: if ($submit->affected_rows() == 1) Code: if ($db1->$submit->affected_rows() == 1) All without result. Probably something small, can anyone shed some light on this? Thanks. Affected-rows question - El Forum - 03-02-2009 [eluser]pistolPete[/eluser] The user guide tells you how it's working: Code: $this->db->affected_rows() In your case: Code: $db1->affected_rows() Affected-rows question - El Forum - 03-02-2009 [eluser]Las3r[/eluser] Thanks pete, that's right. I guess php-ing too much sometimes clouds the min. I tried a bit too much i guess ^^ ! Thanks. |