Search code examples
phpmysqlmysql-pconnect

Pros and cons of using mysql_pconnect in php


I want to know that when I should use mysql_pconnect instead of mysql_connect.


Solution

  • The answer is you shouldn't use either because the mysql_* extension is deprecated.

    If we rewind several years, then the answer is still pretty much the same - in other DBMS' establishing connections is often slower so persistent connections can be used to increase performance. It's quite common that persistent connections cause more harm than good with mysql/php