![]() |
How do I close a database connection? - 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: How do I close a database connection? (/showthread.php?tid=3456) |
How do I close a database connection? - El Forum - 10-02-2007 [eluser]uris[/eluser] Does CI have any function to close a database connection? I want to be able to close every connection I make manually, but I have not been able to find the CI native function to do this. How do I close a database connection? - El Forum - 10-02-2007 [eluser]Michael Wales[/eluser] Why would you want to do that? Regardless, you can just turn off pconnect in database.php and the connection will be closed at the end of each script's execution. How do I close a database connection? - El Forum - 10-03-2007 [eluser]blackarma[/eluser] uris is right, in some case mysql connection are not closed automatically even with mysql_connect (due to some bad script ending). The method close() exists (line 1020 od the DB_drivers.php file, @access public) but not documented, so to close your database connection just use : $this->db->close(); How do I close a database connection? - El Forum - 10-27-2009 [eluser]Grind[/eluser] [quote author="blackarma" date="1191438925"]uris is right, in some case mysql connection are not closed automatically even with mysql_connect (due to some bad script ending). The method close() exists (line 1020 od the DB_drivers.php file, @access public) but not documented, so to close your database connection just use : $this->db->close();[/quote] Does this still apply to the current version of Codeigniter? |