Previous Page
insert()

Solar_Sql_Adapter_Pgsql
lastInsertId()

Next Page
locale()

lastInsertId()

public int lastInsertId ( string $table default NULL, string $col default NULL )

Get the last auto-incremented insert ID from the database.

Parameters

  • (string) $table: The table name on which the auto-increment occurred.
  • (string) $col: The name of the auto-increment column.

Returns

  • (int) The last auto-increment ID value inserted to the database.

Description

Get the last auto-incremented insert ID from the database.

Postgres SERIAL and BIGSERIAL types create sequences named in this fashion: {$table}_{$col}_seq.

http://www.postgresql.org/docs/7.4/interactive/datatype.html#DATATYPE-SERIAL