Re: MySQL close connection, what's the purpose?

From: Date: Sun, 02 Apr 2006 03:48:14 +0000
Subject: Re: MySQL close connection, what's the purpose?
References: 1 2 3 4 5 6 7 8 9 10 11  Groups: php.general 
Request: Send a blank email to php-general+get-233083@lists.php.net to get a copy of this message
John Nichel wrote:
Jasper Bryant-Greene wrote: <snip>
I never close connections; PHP does that for me and has never caused any problems doing that. I don't see it as sloppy programming, it is a documented feature that PHP closes resources such as database connections at the end of the script.
It's extremely sloppy programming. You're assuming that a) PHP will continue to be a forgiving language when it comes to items like this and b) your script is going to exit normally. The reason this is a 'documented feature' is because PHP is trying to make up for sloppy programming. You shouldn't rely on the language to clean up your toys for you.
If the script exits abnormally the connection is still closed. Test it. I'm happy to gamble on a) as because I have said in earlier posts I am very confident this behaviour will not change in the forseeable future. -- Jasper Bryant-Greene General Manager Album Limited http://www.album.co.nz/ 0800 4 ALBUM jasper@album.co.nz 021 708 334

« previous php.general (#233083) next »