[prog] MySQL connections from PHP files - Close or keep it open for queries?

cafeine cafeine at no-log.org
Wed May 4 01:45:29 EST 2005


Conor Daly <c.daly at met.ie> writes:

> On Sun, May 01, 2005 at 05:24:32PM +0200 or thereabouts, cafeine wrote:
>> 
>> I also used mysql_pconnect() in situations where my application was the
>> only mySQL client. You might be interested in looking at it.
>
> Why the "only mySQL client"?  As I understand it, $id_1 = mysql_pconnect() and
> $id_2 = mysql_pconnect() will allow multiple persistent connections with
> different $id, allowing different applications to communicate without
> tramping on each other's toes.  

Sorry, that wasn't very clear. Of course you're right, what I meant was
that the application was the only one using the mySQL server - thus no
risk of getting a "Too many connections" error.

Now that I have read this: http://www.php.net/manual/en/function.mysql-pconnect.php
I assume using mysql_pconnect() is bad practice. Sorry for giving bad advice... 

cafeine

-- 
"Men get defensive when women critique their oppressive and sexist
behaviors. Rather than listening and benefiting from criticism, a
defensive stance is taken and women's voices are ignored once again."
-Angela Beallor



More information about the Programming mailing list