Your Ad Here

Saturday, November 7, 2009

Difference between mysql_connect and mysql_pconnect

mysql_connect open a new connection to the database

but mysql_pconnect open a persistant connection to the database

Mysql_connect()->we can colse the datedase
Mysql_pconnect()->we can't close the datadase

Mysql_conect()->opens the database every time page is load
Mysql_pconnect()->Need not to the every time page load

mysql_connect everytime open a new connection to the database


while using mysql_pconnect , the function would first try to
find a (persistent) link that's already open with the same
host, username and password. If one is found, an identifier
for it will be returned instead of opening a new connection...
the connection to the SQL server will not be closed when the
execution of the script ends. Instead, the link will remain
open for future use.

No comments:

Post a Comment

Your Ad Here