Freelancers Network
 
skill list top cap
Homepage
Join the Freelancer's Network
Update your details
Find a freelancer
Post a project
Find a project
Projects Archive
Post a job
Find a job
Jobs Archive
See Dan's Pages
See Andy's Pages
Link to this site
Resources
Join/Leave Forum
Forum Messages
+Additions+ Adverts
Advertising
Contact Us
Subscribe to our newsletter - enter your email address and hit return
Freelancers.net is owned and operated by Andy Stowell and Dan Winchester
skill list end cap
guru web hostcom

Find me again on Freelancers.net

Re: FN-FORUM: PHP / MySQL Closing connections

date posted 21st August 2003 16:35

Bill Martin wrote:

> In a php script when you connect to a database (mysql_connect) then run
> a few queries and the page exits, does it automatically close the
> connection to mysql or do you have to close it in the code? I know it
> may be bad practice not to close it but I was under the impression it
> closed itself.

PHP *should* close the connection for you at the end of the script.
From http://uk.php.net/mysql_close :

"Using mysql_close() isn't usually necessary, as non-persistent open
links are automatically closed at the end of the script's execution."

> The other problem is that when I run a CHECK_TABLE command on a table in
> the database I get e.g. '12 clients is using or hasn't closed the table
> properly'. The check table command seems to clear this warning and
> running it again says the table is ok, but after a few days it starts to
> build up again the longer I leave it the more clients haven't closed the
> table properly. Is this a normal occurrence or have I made an oversight
> somewhere?

More info here:
http://makeashorterlink.com/?F5FF249A5

HTH
Matt



Messages by Day
August 31st 2003
August 30th 2003
August 29th 2003
August 28th 2003
August 27th 2003
August 26th 2003
August 25th 2003
August 24th 2003
August 23rd 2003
August 22nd 2003
August 21st 2003
August 20th 2003
August 19th 2003
August 18th 2003
August 17th 2003
August 16th 2003
August 15th 2003
August 14th 2003
August 13th 2003
August 12th 2003
August 11th 2003
August 10th 2003
August 9th 2003
August 8th 2003
August 7th 2003
August 6th 2003
August 5th 2003
August 4th 2003
August 3rd 2003
August 2nd 2003
August 1st 2003


Messages by Month
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003


Messages by Year
2009
2008
2007
2006
2005
2004
2003
2002
2001
2000