mysql_ping()
mysql_ping - Ping a server connection or reconnect if there is no connection
Syntax
bool mysql_ping (
resource $link_identifier)
Arguments
- link_identifier - The MySQL connection. If the link identifier is not specified, the last link opened by mysql_connect() is assumed. If no such link is found, it will try to create one as if mysql_connect() was called with no arguments. If no connection is found or established, an E_WARNING level error is generated.
Description
Checks whether or not the connection to the server is working. If it has gone down, an automatic reconnection is attempted. This function can be used by scripts that remain idle for a long while, to check whether or not the server has closed the connection and reconnect if necessary.
Version
PHP 4.3.0, 5
Return value
Returns TRUE if the connection to the server MySQL server is working, otherwise FALSE.