October 5th, 2000, 03:52 PM
I'd read other people's posts in this area, but none has a solution to this problem. I'm hoping that someone would be able to help me with it.
I'm using mysql_pcconnect (persistent) and after like 6-7 reloads I get an error msg saying 'too many connection' or such. Now is there a way that I can explicitely close the connection at the end of the script for mysql_pcconnect so this wouldn't happen again? I'm using a web hosting service so I can't change the settings in mySQL.
Thanks in advance.
October 5th, 2000, 04:55 PM
Why did you choose to use _pconnect? Just curious. It hasn't given me any noticeable benefit when I have used it, but I have received the same error that you have witnessed.
PHP.net has the answer to your question: http://www.php.net/manual/features.p...onnections.php
October 7th, 2000, 08:25 AM
I went through this a couple months ago. After switching my connect statements to pconnect, freeing results, closing db's, ect.., I still got 'TMC' errors. The code was clean and I had minimal db queries - it was driving me bonkers!
Finally someone suggested that it wasn't an issue with the code, rather it was the server my scripts were running on. I was with addr.com which provided dirt cheap hosting (and a lot of webspace). What i figure is there were too many mysql db's running on the same server as mine, thereby overloading the machine.
I proved myself right by getting a new webhost (www.communicom-inc.com). Not a single file has changed - and I haven't received a 'too many connections' error since transferring the site.
October 7th, 2000, 11:58 AM
So if I decided to run my very own mysql server it would solve the problem completely I guess.
Really appreciate your help. Thanks again.