PDA

View Full Version : Reasons for persistent db connection through mysql_pconnect


mail361522
10-29-2009, 02:38 AM
Hello Webassist. I'm using several of your DW Extensions, including Dataassist for dabase driven websites. However on a new project the webhost doesn't work very well with the mysql_pconnect command. As the number of connections are limited they suggest me to use mysql_connect and to close the connection with mysql_close at end of each script. Why have you choosen to use persistent connections and what can I do to make mysql_connect be the default connection type instead? Thank You for help, I'm no Apache or MySQL expert thats why I just want your extensions to work. Now I'm getting "HTTP 500 - Internal server error" all the time... :confused:

Regards Joa

SOJO web
10-29-2009, 10:50 AM
Joa,

The reason it would be used is purely for speed since it would not require connecting over and over... see here for more: http://www.alt-php-faq.org/local/34/


But, yes, the issue you have is also a valid concern for persistent connections.

I think, though, you could simply edit the connect script to use a standard connection with no issue. You could also close the connection at the end of your php page if needed.

Cheers,

Brian