# pg_num_rows

(PHP 4 >= 4.2.0, PHP 5)

pg_num_rows -- Returns the number of rows in a result

## Description

int pg_num_rows ( resource result )

pg_num_rows() will return the number of rows in a PostgreSQL result resource.

Note: This function used to be called pg_numrows().

## Parameters

result

PostgreSQL query result resource, returned by pg_query(), pg_query_params() or pg_execute() (among others).

## Return Values

The number of rows in the result. On error, -1 is returned.

## Examples

Example 1. pg_num_rows() example

 ``` ```

The above example will output:

 `1 row(s) returned.`
{"ft_lang_label":"__label__en","ft_lang_prob":0.63272446,"math_prob":0.64240146,"size":274,"snap":"2022-27-2022-33","text_gpt3_token_len":62,"char_repetition_ratio":0.12962963,"word_repetition_ratio":0.0,"special_character_ratio":0.24817519,"punctuation_ratio":0.15,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9662877,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-07-06T06:43:55Z\",\"WARC-Record-ID\":\"<urn:uuid:72145c33-d3ab-4e27-b6bd-e3c609a70634>\",\"Content-Length\":\"5251\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:3717d753-3778-4e40-9abe-76164d3a457b>\",\"WARC-Concurrent-To\":\"<urn:uuid:b7d8a190-22f5-4ed2-b52b-2d473db4b4f1>\",\"WARC-IP-Address\":\"119.17.137.91\",\"WARC-Target-URI\":\"http://axdf.net/doc/php/html/function.pg-num-rows.html\",\"WARC-Payload-Digest\":\"sha1:CZV5FGIHQK7SFGVMXF4BNZ7DT2ULUP4F\",\"WARC-Block-Digest\":\"sha1:RLDKOWH2O2F63KOI6UUUMAZ2I7VBGYNT\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-27/CC-MAIN-2022-27_segments_1656104668059.88_warc_CC-MAIN-20220706060502-20220706090502-00249.warc.gz\"}"}