So at one point in my code, I use mysqli_ping() to check if a connection to mysql is still alive. In C, doing this will actually reconnect the connection if it dies, but with PHP it just returns true or false, which is fine.
My problem is thus. On occasion, I get this error:
In an effort to prevent this, I have tried EVERYTHING I could think of to prevent the ping from being executed, to absolutely no avail:
I am totally at the end of my rope on this. Anyone have any suggestions?
Thanks.
My problem is thus. On occasion, I get this error:
Code:
Message: mysqli_ping() [<a href='function.mysqli-ping'>function.mysqli-ping</a>]: Couldn't fetch mysqli
In an effort to prevent this, I have tried EVERYTHING I could think of to prevent the ping from being executed, to absolutely no avail:
Code:
if (is_object($conn) && mysqil_ping($conn))
if ($conn != null && mysqli_ping($conn))
if (!empty($conn) && mysqli_ping($conn))
if (isset($conn) && mysqli_ping($conn))
if (!is_null($conn) && mysqli_ping($conn))
try {
mysqli_ping($conn);
} catch (Exception $e){
}
I am totally at the end of my rope on this. Anyone have any suggestions?
Thanks.
Last edited: