Difference between mysql_connect and mysql_pconnect in PHP

mysql_connect and mysql_pconnect both is php function which works with the database connection but with little difference.In the mysql_pconnect “P” stands for persistance connection for the database.Persistent connections are links that do not close when the execution of your script ends.

When we are using  mysql_connect function then always it’s opening and ending the database connection, depending on the request.

But if you using the mysql_pconnect function then  the function would try to find a (persistent) connection that’s already open with the same host, username and password.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).

that’s is the difference between mysql_connect  and mysql_pconnect. 

NB: But for general use mysql_connect() is best.