Re: I don't close my databases
From: Andy Hassall (andy_at_andyh.co.uk)
Date: 01/23/04
- Next message: php newbie: "Re: Can someone solve this query for me?"
- Previous message: wally canrell: "Re: I don't close my databases"
- In reply to: wally canrell: "I don't close my databases"
- Next in thread: Rahul Anand: "Re: I don't close my databases"
- Reply: Rahul Anand: "Re: I don't close my databases"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 23 Jan 2004 19:12:20 +0000
On Fri, 23 Jan 2004 10:09:45 GMT, wallycantrell@hotmail.com (wally canrell)
wrote:
>Yes it is true ... nowhere in my code do I close a database.
>
>This is based on instruction that followed this advice:
>
><quote>
>Using mysql_close() isn't usually necessary, as non-persistent open
>links are automatically closed at the end of the script's execution.
>See also freeing resources. </quote>
>
>http://www.zend.com/manual/function.mysql-close.php
>
>I am using a shared hosting environment and there is a lot ot talk
>about closing databases.
>
>So .. do I need to close my databases or not?
No, you don't need to. The manual is correct, it's closed for you at the end
of the script.
But it might be polite to do so if connections are limited, if you know that
you don't need the database connection past a certain point in the page.
If your page takes a second to run, and you only need it for the first tenth
of a second, then freeing it up early makes it available to others.
-- Andy Hassall <andy@andyh.co.uk> / Space: disk usage analysis tool <http://www.andyh.co.uk> / <http://www.andyhsoftware.co.uk/space>
- Next message: php newbie: "Re: Can someone solve this query for me?"
- Previous message: wally canrell: "Re: I don't close my databases"
- In reply to: wally canrell: "I don't close my databases"
- Next in thread: Rahul Anand: "Re: I don't close my databases"
- Reply: Rahul Anand: "Re: I don't close my databases"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|