Name

mysql_ping( )

Synopsis

mysql_ping([connection])

Use this to determine if the current MySQL connection is still open. If it’s not open, the function attempts to reestablish the connection. If the connection is open or reopened, true is returned. If the connection is not open and cannot be reestablished, false is returned. An identifier may be given to ping a different connection.

...
$ping = mysql_ping($connection);
print "Info:  $ping \n";
...

This function is available as of Version 4.3 of PHP.

Get MySQL in a Nutshell 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.