Home > PHP > Function > PostgreSQL > pg_num_rows()

pg_num_rows()

pg_num_rows - Returns the number of rows in a result

Syntax

int pg_num_rows (resource $result)

Arguments

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

Description

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

Version

PHP 4.2.0, 5

Return value

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