Mysql_pconnect?


#1

Hi

I’ve recently changed my site to start using mysql_pconnect instead of mysql_connect (so I would get persistant connections as my site is very simple). But I was surprised to see 246 connections for today, which would imply that pconnect isn’t working and it’s creating a new connection everytime.

Is there something I’m missing, or isn’t this actually working?

My connection code is as follows:

$ret = mysql_pconnect($dbserver, $dbusername, $dbpassword); mysql_select_db($databasename, $ret) or die("Couldn't select the database - ".$databasename."- " . mysql_error());Regards
elFarto


#2

Ah, I’ve found the problem, I was running PHP as CGI.

Regards
elFarto