wpdb::flush() public WP 0.71
Kills cached query results.
{} Это метод класса: wpdb{}
Хуков нет.
Возвращает
null
. Ничего.
Использование
global $wpdb; $wpdb->flush();
Список изменений
С версии 0.71 | Введена. |
Код wpdb::flush() wpdb::flush WP 5.7.1
public function flush() {
$this->last_result = array();
$this->col_info = null;
$this->last_query = null;
$this->rows_affected = 0;
$this->num_rows = 0;
$this->last_error = '';
if ( $this->use_mysqli && $this->result instanceof mysqli_result ) {
mysqli_free_result( $this->result );
$this->result = null;
// Sanity check before using the handle.
if ( empty( $this->dbh ) || ! ( $this->dbh instanceof mysqli ) ) {
return;
}
// Clear out any results from a multi-query.
while ( mysqli_more_results( $this->dbh ) ) {
mysqli_next_result( $this->dbh );
}
} elseif ( is_resource( $this->result ) ) {
mysql_free_result( $this->result );
}
}