Welcome Guest, Not a member yet? Register   Sign In
close mysql connection
#1

[eluser]dexter21[/eluser]
Hi,

its posible to close db connection with database , for example at the end of a view write as a mysql_close() or similiar


Many thanks
#2

[eluser]Colin Williams[/eluser]
What are you trying to achieve by closing the connection? You can use the close() method, if you must.

Code:
$this->db->close();
#3

[eluser]obiron2[/eluser]
be careful though.

I was reading on one of the boards here that even if you close the connection, if you try to re-access it, CI will open it again for you.

Obiron
#4

[eluser]dexter21[/eluser]
Ok, just the dude that i've , if i call to another controller , i'll load automaticaly form me.

many thanks
#5

[eluser]al404[/eluser]
CI dosen't open and close automaticly DB connection at the beginning and at the end of the file?
#6

[eluser]Colin Williams[/eluser]
CI will open a connection right after the Controller is instantiated if the database class is autoloaded, or when the load->database() method is called, or when a model is called and instructed to load the database. CI closes any open connection just before exiting.




Theme © iAndrew 2016 - Forum software by © MyBB