[wp-hackers] Closing Mysql connections

Andrew Gray andrew at graymerica.com
Fri Mar 19 15:19:37 UTC 2010


that is perfect.
On Mar 19, 2010, at 10:33 AM, Otto wrote:

> On Fri, Mar 19, 2010 at 7:57 AM, Dion Hulse (dd32) <wordpress at dd32.id.au> wrote:
>> The reason for this is quite simple. WordPress uses the database throughout
>> the execution of the script, It's needed until shutdown as you'd expect.
> Yes. As it says here: http://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.
> See also freeing resources."
> Now, that being said, I have seen odd setups freak out on this before,
> but those setups are rare. If you're really paranoid about this sort
> of thing:
> add_action('shutdown_action_hook','close_up_shop');
> function close_up_shop() {
>  @mysql_close();
> }
> You can try it and see if you see a difference. I doubt that there will be any.
> -Otto
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers

More information about the wp-hackers mailing list