mysql_pconnect

mixed mysql_connect([string host[:port|:/path/to/socket]], 
 [string username], [string password]) 
host Desired host, with optional port or socket component
username Username to log in with
password Password to log in with

Opens a persistent connection to a MySQL server.

Returns:

MySQL link on success; FALSE on failure

Description:

mysql_pconnect() behaves like mysql_connect() with two exceptions:

  • The connection is persistent and will not close when the current script exits. This improves efficiency by not forcing the MySQL server to open a new connection every time PHP needs to connect to a database.

  • The connection cannot be closed by mysql_close().

The mysql.allow_persistent configuration directive enables/disables the use ...

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.