Forum Moderators: coopster

Message Too Old, No Replies

Changing pconnect to connect

         

zulufox

4:17 pm on Apr 20, 2005 (gmt 0)

10+ Year Member



I have a custom script on my site for about a year. This script uses pconnect. My hosting (which I like) is asking that I change it to connect.

I don't know anything about php, could I just go through the script and change all the times it says "pconnect" to "connect"?

Thanks!

IamStang

9:47 pm on Apr 20, 2005 (gmt 0)

10+ Year Member



According to the manual, pconnect "opens a persistant connection to a mysql server". Whereas connect connects to the server and closes the connection as soon as the script stops.

Based on that info alone, I would say that you can change the pconnect to connect without too many problems, if any. Best to save a backup and test it out first though. Someone else may have better info for you though.

ironik

10:22 pm on Apr 20, 2005 (gmt 0)

10+ Year Member



You should be safe changing all instances of pconnect to connect, however not so long ago a fellow on these forums had some inexplicable problems between the 2 functions.

Ditto the backup, then just mass replace it and do your testing, it should work fine. You also might want to close the connection once the script has finished using it (with mysql_close()).