wpdb::flush PHP Method

flush() public method

Kill cached query results.
Since: 0.71
public flush ( ) : void
return void
    public function flush()
    {
        $this->last_result = [];
        $this->col_info = null;
        $this->last_query = null;
        $this->rows_affected = $this->num_rows = 0;
        $this->last_error = '';
        if (is_resource($this->result)) {
            if ($this->use_mysqli) {
                mysqli_free_result($this->result);
            } else {
                mysql_free_result($this->result);
            }
        }
    }

Usage Example

コード例 #1
0
 /**
  * If you do not iterate over all the rows returned, be sure to call this function
  * on all remaining rows to free resources.
  * @return void
  */
 public function freeResult()
 {
     if ($this->mysqlResults) {
         if ($this->useMysqli) {
             if ($this->debug) {
                 mysqli_free_result($this->mysqlResults);
             } else {
                 @mysqli_free_result($this->mysqlResults);
             }
         } else {
             if ($this->debug) {
                 mysql_free_result($this->mysqlResults);
             } else {
                 @mysql_free_result($this->mysqlResults);
             }
         }
         $this->mysqlResults = null;
         $this->wpdb->flush();
     }
 }
All Usage Examples Of wpdb::flush