CodeIgniter Forums
Is $this->db->insert_id() safe ? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Is $this->db->insert_id() safe ? (/showthread.php?tid=42742)



Is $this->db->insert_id() safe ? - El Forum - 06-17-2011

[eluser]Rushino[/eluser]
Hello,

I was wondering if Is $this->db->insert_id() is safe ? I mean if two person insert data to a datebase in the same time.. can this cause any problem ? or it is linked to the result ressource ?

Thanks.


Is $this->db->insert_id() safe ? - El Forum - 06-17-2011

[eluser]osci[/eluser]
$this->db->insert_id() uses mysql_insert_id(). Take a look at the notes there.


Is $this->db->insert_id() safe ? - El Forum - 06-17-2011

[eluser]CroNiX[/eluser]
Two people will never be inserting data on the same mysql resource link at the same time.