List:General Discussion« Previous MessageNext Message »
From:matthew mcglynn Date:July 1 1999 7:08am
Subject:Re: persistent MySQL connections in PHP
View as plain text  
> I've got a large multi-user PHP app that uses mysql_connect() throughout,
> and would like to convert to mysql_pconnect().  Is it enough simply to
> change every instance of one to the other,

Yes.

> or must care be taken, for
> example, not to have two pconnect calls within the same script (to avoid
> spawning unnecessary processes with each call)?

No; mysql_pconnect() is smart enough to re-use an existing
connection if one is available.

> Finally, if mysql_pconnect() is so much better on overhead than
> mysql_connect(), why wouldn't I always use it?  Put another way, is there
> any reason _not_ to use it?

I use it extensively in a variety of high-traffic websites.
I know of no reason to use mysql_connect rather than _pconnect.

--
matt.


Thread
persistent MySQL connections in PHPTroy Grady1 Jul
  • Re: persistent MySQL connections in PHPmatthew mcglynn1 Jul
    • Re: [PHP3] Re: persistent MySQL connections in PHPChad1 Jul
    • Re: [PHP3] Re: persistent MySQL connections in PHPKristian K√∂hntopp1 Jul
    • Re: [PHP3] Re: persistent MySQL connections in PHPChad Cunningham2 Jul