CodeIgniter Forums
What does $this->db->insert_id() return if the insert fails? - 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: What does $this->db->insert_id() return if the insert fails? (/showthread.php?tid=58651)



What does $this->db->insert_id() return if the insert fails? - El Forum - 07-03-2013

[eluser]warpspasm[/eluser]
Hi Everyone

What does $this->db->insert_id() return if the insert fails?

Thanks!


What does $this->db->insert_id() return if the insert fails? - El Forum - 07-03-2013

[eluser]Otemu[/eluser]
Hi,

See explanation below:

Quote:The ID generated for an AUTO_INCREMENT column by the previous query on success, 0 if the previous query does not generate an AUTO_INCREMENT value, or FALSE if no MySQL connection was established.