function PdoResult::rowCount

Returns the number of rows matched by the last SQL statement.

Return value

int The number of rows matched by the last DELETE, INSERT, or UPDATE statement executed or throws \Drupal\Core\Database\RowCountException if the last executed statement was SELECT.

Overrides ResultBase::rowCount

File

core/lib/Drupal/Core/Database/Statement/PdoResult.php, line 48

Class

PdoResult
Class for PDO-provided results of a data query language (DQL) statement.

Namespace

Drupal\Core\Database\Statement

Code

public function rowCount() : ?int {
  return $this->clientRowCount();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.