For Programmers: Free Programming Magazines  


Home > Archive > PHP Programming > April 2004 > CLOSE MYSQL SESSION









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author CLOSE MYSQL SESSION
Carlos Marangon

2004-04-30, 9:17 am

hello!

My server provides me 15 simultaneous connections to MySQL.
What is the comand to close the sessions ?


Carlos
Chris Hope

2004-04-30, 9:17 am

Carlos Marangon wrote:

> My server provides me 15 simultaneous connections to MySQL.
> What is the comand to close the sessions ?


Assuming you aren't using persistant connections your connection will close
when the script terminates. It's always good programming practice to
explicitly close the connection regardless; the mysql_close() function does
this.

I suggest reading the MySQL section of the PHP manual which can be found at:
http://www.php.net/manual/en/ref.mysql.php

--
Chris Hope
The Electric Toolbox - http://www.electrictoolbox.com/
Jan Pieter Kunst

2004-04-30, 9:17 am

In article <1083309774_12990@news.athenanews.com>,
Chris Hope <chris@electrictoolbox.com> wrote:

>
> Assuming you aren't using persistant connections your connection will close
> when the script terminates. It's always good programming practice to
> explicitly close the connection regardless; the mysql_close() function does
> this.


But note this, from <http://nl.php.net/mysql_close>:

mysql_close() will not close persistent links created by
mysql_pconnect().

JP

--
Sorry, <devnull@cauce.org> is een "spam trap".
E-mail adres is <jpk"at"akamail.com>, waarbij "at" = @.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com