You have the following methods of the `$wpdb` object:

 -   `$wpdb->check_connection()` that contains a call to `mysqli_free_result()` or `mysql_free_result()` if not supported. 

 -   `$wpdb->flush()` that contains a call to `mysqli_ping()` or `mysql_ping()` if not supported. 

You can of course use all your PHP functions in WordPress.