Check whether mysqli connection is made or not in php

1 · Subin Siby · May 29, 2013, 4:37 p.m.
This function helps to check whether connection the mysql server has been made or not. Here is the code: if ($mysqli->ping()) { echo ("Our connection is ok!n"); } else {      printf ("Error: %sn", $mysqli->error); } The $mysqli variable is a connection made via mysqli function. Know more about mysqli ping function here....