Welcome Guest, Not a member yet? Register   Sign In
It's possible to connect to a DB but... closing a connection?
#1

[eluser]punchi[/eluser]
It's possible?

In PHP, theres a mysql_connect and a mysql_close. Here we connect to a DB (dont know well which function is) but, there's no function to close a connection!!

It's possible (or make the connection null)? How?

Thanks!! =)
#2

[eluser]skunkbad[/eluser]
[quote author="punchi" date="1261381331"]It's possible?

In PHP, theres a mysql_connect and a mysql_close. Here we connect to a DB (dont know well which function is) but, there's no function to close a connection!!

It's possible (or make the connection null)? How?

Thanks!! =)[/quote]
Code:
$this->db->close();
#3

[eluser]punchi[/eluser]
lol... :red:

i don't saw it in the user guide... i though there was all the functions!!, and if there isnt all the functions, there's no API reference? :gulp:!
#4

[eluser]skunkbad[/eluser]
[quote author="punchi" date="1261390937"]lol... :red:

i don't saw it in the user guide... i though there was all the functions!!, and if there isnt all the functions, there's no API reference? :gulp:![/quote]

As far as I know, you are correct. I haven't seen this in the user guide. Unless you are using pconnect, you probably don't need to close the connection. Even w/ pconnect, I'm not sure if you need to close the connection.
#5

[eluser]punchi[/eluser]
If you'r using pconnect, you should close the connection. For a no-pconnect, it's necessary for big querys, because anyway at the end of the script PHP will close connections.

And, is better to have a connection "null" than closing it, at least that appear in discussions in PHP (both ways finish the connection, but closing it can close a TCP layer, giving problems)

So, i'll try the
Code:
$this->db = null;
idea, maybe that line give me an error, but well, I'll try something like that.

Thanks skunkbad! always helping (at least) to me =)




Theme © iAndrew 2016 - Forum software by © MyBB