What is mysql pconnect in PHP
In this article I am going to explain about mysql_pconnect function in PHP.
PHP mysql_pconnect() Function
The PHP mysql_pconnect function opens a persistent connection to MySQL database from php script. The advantage of mysql_pconnect over mysql_connect function is that, you do not need to close the connection like mysql_connect function and it also keeps the connection live even the script execution is over.
Syntax of mysql_pconnect function
|mysql_pconnect(server, user, pwd, clientflag)
Parameters in mysql_pconnect function
It have four parameter:
||It specifies mysql server name.
||It specifies username for login.
||It specified password for login.
||Clientflag parameter can be combination of many of constants.
Example of mysql_pconnect function
die("Could not connect:".mysql_error());
echo "Connection established successfully";
//Here you do not need to close the connection.
You may also want to read these related articles :here
Ask Your Question
Got a programming related question? You may want to post your question here
Programming Answers here