pg_getlastoid

(PHP3 , PHP4 )

pg_getlastoid -- Returns the last object identifier

Description

int pg_getlastoid (int result_id)

Pg_getlastoid() can be used to retrieve the oid assigned to an inserted tuple if the result identifier is used from the last command sent via pg_exec() and was an SQL INSERT. This function will return a positive integer if there was a valid oid. It will return -1 if an error occured or the last command sent via pg_exec() was not an INSERT.