php mysqli ping function allows you to check the connection to the database server. The ping function sends a ping to the database server and waits for a response. If there is no response from the server, it means the connection is lost. The syntax of the mysqli ping function is as follows:
if (mysqli_ping($link)) { echo "Connection is active"; } else { echo "Connection is lost"; }
This example shows how to check the connection to the database server. If the connection is active, then it will display a message "Connection is active", otherwise, it will display "Connection is lost".
The mysqli_ping function is a part of the MySQLi package library in PHP.
PHP mysqli::ping - 30 examples found. These are the top rated real world PHP examples of mysqli::ping extracted from open source projects. You can rate examples to help us improve the quality of examples.