Home > PHP > Function > PostgreSQL > pg_affected_rows()

pg_affected_rows()

pg_affected_rows - Returns number of affected records (tuples)

Syntax

int pg_affected_rows (resource $result)

Arguments

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

Description

pg_affected_rows() returns the number of tuples (instances/records/rows) affected by INSERT, UPDATE, and DELETEqueries.

Version

PHP 4.2.0, 5

Return value

The number of rows affected by the query. If no tuple is affected, it will return 0.