pg_cmdtuples

(PHP 3, PHP 4 >= 4.0.0)

pg_cmdtuples -- Returns number of affected records(tuples)

Description

int pg_cmdtuples ( resource result)

pg_cmdtuples() returns the number of tuples (instances/records/rows) affected by INSERT, UPDATE, and DELETE queries executed by pg_exec(). If no tuple is affected by this function, it will return 0.

Example 1. pg_cmdtuples()

<?php
$result = pg_exec ($conn, "INSERT INTO publisher VALUES ('Author')");
$cmdtuples = pg_cmdtuples ($result);
echo $cmdtuples . " tuples are affected.";
?>

See also pg_exec() and pg_numrows().