pg_last_oid

(PHP 4 >= 4.2.0)

pg_last_oid -- Returns the last object's oid

Description

int pg_last_oid ( resource result)

pg_last_oid() is used to retrieve the oid assigned to an inserted tuple (record) if the result resource is used from the last command sent via pg_query() and was an SQL INSERT. Returns a positive integer if there was a valid oid. It returns FALSE if an error occurs or the last command sent via pg_query() was not an INSERT or INSERT is failed.

Poznßmka: This function used to be called pg_getlastoid().

See also pg_query().