Forum Moderators: coopster

Message Too Old, No Replies

mysql_pconnect()

Does anyone use this function? Is perfomance better?

         

Warboss Alex

12:29 pm on Apr 27, 2004 (gmt 0)

10+ Year Member



Hey all,

About the mysql_pconnect() function, which opens a persistent connection to the database, which future database connections can link to.

Does anyone use this function? If so, is perfomance really better?

I'm just curious, I used it a lot when I started learning PHP but I've since evolved to opening and closing connections instead of having one 'global' connection across the scripts which make up the web pages I make. Of course, this's depend on the script I suppose ..

Hardly any of the PHP articles I read use this function (a few warn that using the function might cause the server to hang), but it's recommended in 'Programming PHP' by Rasmus Lerdorf ..

bcolflesh

12:40 pm on Apr 27, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



On dedicated servers where I can tweak the MySQL and Apache config, I use it without problems - it's bad news in shared environments, where it inevitably leads to the "MySQL - too many connections" error.