PHP kézikönyv
Előző |  | Következő

# pg_last_oid

(PHP 4 >= 4.2.0, PHP 5)

pg_last_oid -- Returns the last object's oid

## Leírás

string 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 number 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.

OID field became an optional field from PostgreSQL 7.2. When OID field is not defined in a table, programmer must use pg_result_status() to check if record is inserted successfully or not.

> Megjegyzés: This function used to be called pg_getlastoid().

## Lásd még

pg_query()
pg_result_status()

Előző | Tartalom | Következő
pg_last_notice | Fel | pg_lo_close