Deletes rows that match condition. It will return number of affected rows.
@return int
965282
public function delete()
    {
        $query = "DELETE FROM `{$this->table}` {$this->join}";
        if ($this->condition) {
            $query .= " WHERE {$this->condition}";
        }
        if ($this->limit) {
            $query .= " LIMIT {$this->limit}";
        }

        return $this->connection->execQuery($query, $this->params);
    }
220533
private function cleanup()
    {
        foreach ($this->threads as $i => $szal)
            if (!$szal->isAlive()) {
                $this->results[] = $this->threads[$i]->result;
                unset($this->threads[$i]);
            }
        return count($this->threads);
    }
479379
public function affectedRows()
	{

		//put this in try...catch block for better error handling
		try{

			//check if there is valid service instance
			if ( ! $this->validService() ) 
			{
				//throw exception
				throw new MySQLException("Not connected to a valid database service");

			}

			//get number of affected rows and return
			return $this->service->affected_rows;

		}

		//diplay error message
		catch(MySQLException $MySQLExceptionObject){

			//display error message
			$MySQLExceptionObject->errorShow();

		}

	}
261605
public function affected_rows($result = null)
    {
        if ($result || ($result === null && ($result = $this->last_result))) {
            if ($result !== true) {
                return $result->rowCount();
            }
        }

        return 0;
    }
1239547
public function rowCount()
    {

        $query = $this->run(false, false);

        if ($query instanceof PDOStatement) {
            return $query->rowCount();
        } elseif ($query instanceof mysqli_stmt) {
            $query = $query->get_result();

            return $query->num_rows;
        } else {
            return false;
        }
    }
966353
protected function _delete(array $criteria = array())
    {
        if (!is_null($this->_table)) {
            $this->_affectedRows = $this->_db->delete($this->_table, $criteria);
            return $this->_affectedRows;
        }
    }
837813
public function delete()
    {
        $data = $this->getData();
        if (isset($this->currentId))
        {
            unset($data[$this->currentKey]);
        }
        else
        {
            $this->pending();
            $old  = $data;
            $data = array_diff_key($old, $this->data);
        }
        $this->data = array_values($data);

        return Helpers\Data::table($this->name)->put($this->data) ? true : false;
    }
1044746
public function count()
    {
        if ($this->_rowCount === null) {
            $rowCount = $this->_query->count();
            $this->setRowCount($rowCount);
        }

        return $this->_rowCount;
    }
1372122
public function delete()
    {
        self::$instance->reset();
        $this->sql('DELETE');
        $this->oosql_where = null;
        $numargs = func_num_args();

        if ($numargs > 0) {
            if ($numargs > 1) {
                $this->oosql_del_multiFlag = true;
                $this->oosql_del_numargs = $numargs;
            }
            $arg_list = func_get_args();
            if (is_array($arg_list[0])) {
                $this->sql(' FROM ' . $this->oosql_table);
                $this->where($arg_list[0][0] . ' = ?', $arg_list[0][1]);
                return $this;
            }
            $this->oosql_sql .= ' FROM';
            for ($i = 0; $i < $numargs; $i++) {
                if ($i != 0 && $numargs > 1) {
                    $this->sql(',');
                }
                $this->sql(' ' . $arg_list[$i]);
            }

        } else {
            $this->oosql_fromFlag = true;
        }


        return $this;
    }
1188223
public function delete(): int
	{
		$query = $this->compiler->delete();

		return $this->connection->queryAndCount($query['sql'], $query['params']);
	}
1047018
public function count()
    {
        if (empty($this->queryString)) {
            $builder = clone $this->builder;
            $builder->resetQueryPart('orderBy');
            $stmt = $builder->execute();
        } else {
            $stmt = $this->connection->executeQuery($this->queryString, $this->queryParams);
        }

        return (int) $stmt->rowCount();
    }
879414
public static function countAll () : int
	{
        $dbObject  	= Database::getInstance();
		$sqlQuery 	= "SELECT COUNT(*) FROM ".static::$tableName;
		$resultSet 	= $dbObject->query($sqlQuery);
		$row 		= Database::fetchAssoc($resultSet);
		return (int) array_shift($row);
	}
537228
public function delete(): bool
    {
        /**
         * Execute pre-DELETE logic
         */
        $this->beforeDelete();

        $primaryKey = $this->getPrimaryKey();

        /**
         * Execute the DELETE (this may throw an exception)
         */
        $table = $this->getTable();
        $result = $table::delete($primaryKey);

        /**
         * Execute post-DELETE logic
         */
        $this->afterDelete();

        /**
         * Reset all fields to null to indicate that the row is not there
         */
        $this->resetArray();

        return $result > 0;
    }
446546
public function affectedRows(){
		$this->performed || $this->run();
		if($this->affectedRows === false)
			throw new DriverException('Affected rows are not supported by this driver.');
		return $this->affectedRows;
	}
703698
public function destroy()
    {
        $keys = [];

        foreach ($this->rows as $key => $row) {
            if ($this->rowStateIsNew($key)) {
                continue;
            }

            $keys[] = $this->rowFirstUnique($row);

            $this->markRowAsNew($key);
        }

        if ($keys) {
            [$sql, $params] = $this->newDeleteQuery()->where($this->firstUniqueKey(), $keys)->toSql();

            $this->connection()->sqlExecute($sql, $params);
        }

        return $this;
    }
169263
private function getDeleteQuery()
	{

		$result = $this->getDeleteClause();

		if ($where = $this->getWhereClause()) {
			$result .= ' ' . $where;
		}

		if ($limit = $this->getLimitClause()) {
			$result .= ' ' . $limit;
		}

		return $result;
	}
3485
public function numAffectedRows()
    {
        if( !isset( $this->affectedRows ) ) {
            $this->affectedRows = pg_affected_rows( $this->resource );
        }
        return $this->affectedRows;
    }