mysql_close of no use. right??

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
claws
Forum Commoner
Posts: 73
Joined: Tue Jun 19, 2007 10:54 am

mysql_close of no use. right??

Post 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.
claws
Forum Commoner
Posts: 73
Joined: Tue Jun 19, 2007 10:54 am

Post 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?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

To keep performance up, you should release any resources you are consuming when you finish using them on any given page.
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post 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!
Post Reply