|
| |
PHP MySQL Persistence Connection |
Please read mysql_connect to know all details about connecting the mysql database. Here we will see the difference between mysql_connect and mysql_pconnect function. Mysql_pconnect works same as mysql_connect with two differences. Mysql_pconnect function keeps the connection live even the script execution is over. It does not close the connection like mysql_connect case where it closes the connection once the script execution is over. The other difference is it tries to find any existing connection exists and return a identifier if exists.
The main purpose of using mysql_pconnect function is to maintain a persistence connection to the mysql server. Function mysql_close() can't close persisitence connection.
mysql_pconnect ("$servername","$dbuser","$dbpassword");
| |
|
|
|