Should I check for a MySQL connection with is_resource or mysqli_ping?
<p>Should I check for a MySQL connection with <code>is_resource</code> or <code>mysqli_ping</code>? Why?</p>

<pre><code>if (!mysql_ping($mysqli)) {
    $mysqli = new mysqli($db_host,
                         $db_username,
                         $db_password,
                         $db_name);
}

if (!is_resource($mysqli)) {
    $mysqli = new mysqli($db_host,
                         $db_username,
                         $db_password,
                         $db_name);
}
</code></pre>