Returns the number of the rows fetched by the last retrieving query.

@return int|false
Returns the number of the rows fetched by the last retrieving query. In the case
of any error returns false.

@author Oleg Schildt
769589
public function fetched_count()
    {
        if (!$this->statement) {
            $this->last_error_id = "db_result_error";
            return false;
        }
        
        if (!is_resource($this->statement)) {
            return false;
        }
        
        /*
        If the cursor is SQLSRV_CURSOR_STATIC or other than
        SQLSRV_CURSOR_FORWARD, retreiving of the data
        has sometimes very poor performance. Not the query execution,
        but the data retrieving!
    
        The default is SQLSRV_CURSOR_FORWARD, but it is not possible
        to get fetched_count by this type of cursor. So we sacrifice
        the possibility to get fetched_count for the preformance.
        The preformance is more important.
    
        no more relevant in new version of driver
        */
        
        return @sqlsrv_num_rows($this->statement);
    }
1297307
public function fetchRow()
    {
        $opts = $this->options;
        $opts['limit'] = 1;
        
        $sql = QueryBuilder::optionsToSql($opts);
        $row = $this->getDb()->getRow($sql);
        
        return $row;        
    }
1174215
public function numRows() {
        if ($this->numRows === null) {
            // no support for num_rows() in SQLite3, need to count manually
            $previous = $this->nextRowIndex;

            while ($this->fetchRow());                          // loop from current position to the end

            // we hit the end
            if ($this->numRows) {
                $this->result->reset();                         // back to start
                $this->nextRowIndex = 0;
                while ($previous--) {                           // loop back to former position
                    $this->fetchRow();
                }
            }
        }
        return $this->numRows;
    }
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();
    }
549765
public function numRows()
    {
        if( !isset( $this->numRows ) ) {
            $this->numRows = pg_num_rows( $this->resource );
        }
        return $this->numRows;
    }
385635
public function count()
    {
        if ($this->numberOfRows === null) {
            if (is_array($this->rows)) {
                $this->numberOfRows = count($this->rows);
            } else {
                $this->numberOfRows = $this->query->count();
            }
        }
        return $this->numberOfRows;
    }
1025766
protected function getTotalCount()
    {
        $query = $this->modelRepository->query();

        $this->applyListParentToQuery($query);

        return $query->count();
    }
1088423
public function getTotal()
    {
        $query = $this->getQuery()->select('COUNT(*) as total');

        $rows = $this->database->query($query, $this->database->getBinds());

        if (!isset($rows[0]['total'])) {
            return 0;
        }

        return $rows[0]['total'];
    }
904504
public function rowCount(): int
    {
        if (!$this->wasExecuted()) {
            $this->exec();
        }

        return $this->getAdapter()->getStatement()->rowCount();
    }
926035
protected function GetRemainingRowCount()
    {
        $aTableList = $this->aTablesToProcess;
        $iCount = 0;
        foreach ($aTableList as $iWorkId) {
            $oIndexQuery = TdbShopSearchQuery::GetNewInstance();
            /** @var $oIndexQuery TdbShopSearchQuery */
            if ($oIndexQuery->Load($iWorkId)) {
                $iCount = $iCount + $oIndexQuery->NumberOfRecordsLeftToIndex();
            }
        }

        return $iCount;
    }
792227
public function count()
    {
        $query   = $this->query();
        $myQuery = $query instanceof EloquentBuilder ? clone $this->query() : $query;
        if ($query instanceof Collection) {
            return $query->count();
        }

        $finalQuery = $this->applyScopes($myQuery);
        $this->applyGlobalGroupScope($finalQuery);


        // if its a normal query ( no union, having and distinct word )
        // replace the select with static text to improve performance
        $connection = $finalQuery->getQuery()->getConnection();

        if (!Str::contains(Str::lower($finalQuery->toSql()), ['union', 'having', 'distinct', 'order by', 'group by'])) {

            $row_count = $connection->getQueryGrammar()->wrap('row_count');
            return $connection->table($connection->raw('(' . $finalQuery->toSql() . ') count_row_table'))->select($connection->raw("'1' as {$row_count}"))->setBindings($finalQuery->getBindings())->count();
        }

        return $connection->table($connection->raw('(' . $finalQuery->toSql() . ') count_row_table'))
                        ->setBindings($finalQuery->getBindings())->count();
    }
1286474
public function getLastRow()
    {
        if($this->last_row == null) {
            $this->last_row = (int) $this->getActiveSheet()->getHighestRow();
        }

        return $this->last_row;
    }
1188994
public function countUngenerated()
    {
        $query = $this->createQuery();
        $query->matching($query->logicalAnd($query->equals('resource', null), $query->equals('staticResource', null)));
        return $query->count();
    }
1020558
public function numRows(): ?int
	{
		$regex = '/^SELECT\s+(?:ALL\s+|DISTINCT\s+)?(?:.*?)\s+FROM\s+(.*)$/i';
		$output = [];

		if (preg_match($regex, $this->lastQuery, $output) > 0)
		{
			$stmt = $this->query("SELECT COUNT(*) FROM {$output[1]}");
			return (int) $stmt->fetchColumn();
		}

		return NULL;
	}
1187914
public function count()
    {
        if ($this->rows_count == null) {
            $this->rows_count = $this->result->countRows();
        }

        return $this->rows_count;
    }
837715
public function count()
    {
        $this->assembleQueryWithJoins();
        $q = clone $this->source;
        $q = $q->resetDQLPart('orderBy')->select('COUNT(' . $this->currentAlias . ')')->getQuery();
        return $q->getSingleScalarResult();
    }
615053
private function obtainNumRows()
    {
        $count = 0;
        while (false !== $this->stmt->fetch(PDO::FETCH_NUM)) {
            $count = $count + 1;
        }
        $this->stmt->execute();
        return $count;
    }