Page 1 of 1

mysql_close of no use. right??

Posted: Thu Dec 20, 2007 6:30 am
by claws
sorry..
the question may be strange.
i felt so.
i mean. if i use mysql_connect just after my script execution the connection is anyway closed automatically.

if i use mysql_pconnect. mysql_close will not close this connection.

then whats the use?

thats why i am not using mysql_close any where in my scripts. is it ok?? please.. correct me if i am wrong.

Posted: Thu Dec 20, 2007 6:33 am
by claws
or do you say that what if you want to close connection in between the script execution.
on a SERVER, of such high configurations.
how much time does a php script execute.
just fraction of millisecond.
so.. does that really matter?

Posted: Thu Dec 20, 2007 8:32 am
by feyd
To keep performance up, you should release any resources you are consuming when you finish using them on any given page.

Posted: Thu Dec 20, 2007 8:59 am
by Kieran Huggins
I never close my (p)connections either, and don't see a reason to in your typical web server environment. But it's good to have the option there in case you have odd requirements!