Knowledge Base

February 22, 2008

mysql_pconnect() vs mysql_connect()

Filed under: Technical — Tags: , , — rkutti @ 12:35 pm

When connecting, the pconnect wolud first try to find a (persistent) link that’s already open with the same host, username and password. If the link already exist then the identifier for that will be returned instead of opening a new connection. Later, create a new link for each connection.

The Connection to the SQL server will not be closed when the execution of the script ends. Instead the link will be opened for future use and mysql_close() will not will not close links established by mysql_pconnect(). Later, The link to the server will be closed as soon as the execution of the script ends, unless its closed earlier by explicitly calling mysql_close().

Reference: mysql_pconnect() and mysql_connect()

No Comments Yet »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.