Mysql php connection?

can someone tell me the difference between mysql_connect and mysql_pconnect?

+3
source share
2 answers

mysql_pconnect () is very similar to mysql_connect () with two main differences.

Firstly, when connecting, the function will first try to find a (permanent) link that is already open with the same host, username and password. If it is found, the identifier for it will be returned instead of opening a new connection.

Secondly, the connection to the SQL server will not be closed when the script completes. Instead, the link will remain open for future use (mysql_close () will not close the links set by mysql_pconnect ()).

php.net

+7

mysql_connect() mysql_pconnect() , . mysql_pconnect(), p .

mysql_connect(), , , .

mysql_pconnect() -, () , , . , . -, SQL- script. (mysql_close() , mysql_pconnect()).

mysql_pconncet() , . , . . mysql_connect().


:
connect() pconnect, , , , connect() mysql, mysql script. , pconnect(), mysql_pconnect(), "" .

0

Source: https://habr.com/ru/post/1759840/


All Articles