mysql_connect VS. mysql_pconnect
View Single Post
12-19-2007, 06:37 PM
Join Date: Nov 2007
Persistent connections are links that do not close when the execution of your script ends. When a persistent connection is requested, PHP checks if there's already an identical persistent connection (that remained open from earlier) - and if it exists, it uses it. If it does not exist, it creates the link. An 'identical' connection is a connection that was opened to the same host, with the same username and the same password (where applicable).
If persistent connections don't have any added functionality, what are they good for?
The answer here is extremely simple -- efficiency. Persistent connections are good if the overhead to create a link to your SQL server is high. Whether or not this overhead is really high depends on many factors.
There are some pre's and cons about persistent connections, you just have to
The Following User Says Thank You to sjaq For This Useful Post:
View Public Profile
Send a private message to sjaq
Visit sjaq's homepage!
Find More Posts by sjaq