Get the number of returned rows for the previous executed SQL statement.

@param   resource  $cursor  An optional database cursor resource to extract the row count from.

@return  integer   The number of returned rows.

@since   1.0
966282
public function getNumRows($cursor = null)
	{
		$this->connect();

		if ($cursor instanceof \PDOStatement)
		{
			return $cursor->rowCount();
		}

		if ($this->prepared instanceof \PDOStatement)
		{
			return $this->prepared->rowCount();
		}

		return 0;
	}
1262646
public function numRows() {
        if ($this->numRows === null) {
            if (is_resource($this->hResult)) $this->numRows = mysql_num_rows($this->hResult);
            else                             $this->numRows = 0;
        }
        return $this->numRows;
    }
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);
    }
363316
public function foundRows()
    {
        if ($this->hasOption('SQL_CALC_FOUND_ROWS')) {
            return (int) $this->owner->getOne('select found_rows()');
        }
        /* db-compatible way: */
        $c = clone $this;
        $c->del('limit');

        return (int) $c->fieldQuery('count(*)')->getOne();
    }
904504
public function rowCount(): int
    {
        if (!$this->wasExecuted()) {
            $this->exec();
        }

        return $this->getAdapter()->getStatement()->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);
	}
650914
public function GetCount($Table = '', $Where = FALSE) {
      if($Table != '') {
         //$this->MapAliases($Table);
         $this->From($Table);
      }

      if ($Where !== FALSE)
         $this->Where($Where);

      $this->Select('*', 'count', 'RowCount'); // count * slow on innodb
      $Sql = $this->GetSelect();
      $Result = $this->Query($Sql);

      $CountData = $Result->FirstRow();
      return $CountData->RowCount;
   }
549765
public function numRows()
    {
        if( !isset( $this->numRows ) ) {
            $this->numRows = pg_num_rows( $this->resource );
        }
        return $this->numRows;
    }
1239815
public static int getRowCount(Connection connection, String tableReference) throws SQLException {
        Statement st = connection.createStatement();
        int rowCount = 0;
        try {
            ResultSet rs = st.executeQuery(String.format("select count(*) rowcount from %s", TableLocation.parse(tableReference)));
            try {
                if(rs.next()) {
                    rowCount = rs.getInt(1);
                }
            } finally {
                rs.close();
            }
        }finally {
            st.close();
        }
        return rowCount;
    }
1298104
public function row()
    {
        if (isset($this->rows[$this->cursor])) {
            return $this->rows[$this->cursor++];
        }

        return false;
    }
1280351
public function rowCount()
    {
        try {
            if ($this->stmt) {
                return $this->stmt->rowCount();
            }
            return null;
        } catch (\PDOException $e) {
            die("Error: " . $e->getMessage());
        }
    }
793003
public function restGet($cursor) {
        if ($cursor instanceof Cursor) {
            $name = $cursor->getCollection()->getName();
            $criteria = $cursor->getCriteria();
            $limit = $cursor->limit();
            $skip = $cursor->skip();
            $sorts = $cursor->sort();

            $query = array();

            foreach ($criteria as $key => $value) {
                $query[$key] = $value;
            }

            if ($limit) {
                $query['!limit'] = $limit;
            }

            if ($skip) {
                $query['!skip'] = $skip;
            }

            if (!empty($sorts)) {
                foreach ($sorts as $key => $value) {
                    $query["!sort[$key]"] = $value;
                }
            }

            $qs = array();

            foreach ($query as $key => $value) {
                if (is_array($value)) {
                    foreach ($value as $k => $v) {
                        $qs[] = '!'.$key.'='.$v;
                    }
                } else {
                    $qs[] = $key.'='.$value;
                }
            }

            if ($qs) {
                $qs = '?'.implode('&', $qs);
            } else {
                $qs = '';
            }

            $url = $this->option('baseUrl').'/'.$name.'.json'.$qs;

            $client = new Client();
            $response = $client->get($url)->send();

            return json_decode($response->getBody(true), true);
        } else {
            throw new Exception('Unimplemented yet!');
        }
    }
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;
        }
    }
712121
def get_last_sequence(self, cur=None):
        
        sql = 'SELECT sequence FROM {} ORDER BY sequence DESC LIMIT 1;'.format(self.subdomain_table)
        cursor = None
        if cur is None:
            cursor = self.conn.cursor()
        else:
            cursor = cur

        db_query_execute(cursor, sql, ())
        last_seq = None
        try:
            last_seq = cursor.fetchone()[0]
        except:
            last_seq = 0
        
        return int(last_seq)
711827
protected function freeResult($cursor = null)
	{
		$useCursor = $cursor ?: $this->cursor;

		if (\is_resource($useCursor))
		{
			pg_free_result($useCursor);
		}
	}
431959
public function fetched_count()
    {
        if ($this->statement) {
            return $this->statement->num_rows;
        }
        
        if (!$this->mysqli_result) {
            $this->last_error_id = "db_result_error";
            return false;
        }
        
        // by update, insert, delete it is not an object
        // by select it is an object
        // crazy!
        
        if (!is_object($this->mysqli_result)) {
            return false;
        }
        
        return $this->mysqli_result->num_rows;
    }
974672
public function getPages($cursor = false)
    {
        $queryArray = ['pageSize' => 200];
        if ($cursor) {
            $queryArray['cursor'] = $cursor;
        }

        try {
            $response = $this->client->get(
                $this->PagesUrl, [
                    'headers' => ['Authorization' => 'Bearer '. $this->login->apiKey],
                    'verify' => $this->certFile,
                    'query' => $queryArray
            ]);

            $response = [
                'code' => '200',
                'response' => $response->getBody(),
                'error' => false
            ];

        } catch (ClientException $e) {
            $response = $this->parseException($e);

        } catch (ServerException $e) {
            $response = $this->parseException($e);

        } catch (ConnectException $e) {
            $message = 'Can not connect to Leadpages Server:';
            $response = $this->parseException($e, $message);

        } catch (RequestException $e) {
            $response = $this->parseException($e);
        }

        return $response;
    }