Does Codeigniter automatically close the database connection |
Hi ,
I want to know Does Codeigniter automatically close the database connection or we have close manually. If it close the database connection automatically , where can i check this code .
Good question.
I have made this MY_Model located at "core" folder and extends all my models to this. class MY_Model extends CI_Model { /** * MY_Model constructor. */ public function __construct() { parent::__construct(); } public function __destruct() { $this->db->close(); } }
PHP Developer. Codeigniter Fan. Family Lover.
Manually closing the Connection
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
You don't need to.
During shutdown, PHP itself closes any resources that haven't been closed. |
Welcome Guest, Not a member yet? Register Sign In |