php8.5
Home/ Manual/ sqlite3 / sqlite3/ SQLite3::lastInsertRowID

SQLite3::lastInsertRowID

PHP function Edit on GitHub ✎

(PHP 5 >= 5.3.0, PHP 7, PHP 8)

Returns the row ID of the most recent INSERT into the database

Description

SQLite3::lastInsertRowID(): int

Returns the row ID of the most recent INSERT into the database.

Parameters Parameters

Return Values

Returns the row ID of the most recent INSERT into the database. If no successful INSERTs into rowid tables have ever occurred on this database connection, then SQLite3::lastInsertRowID returns 0.

Source: reference/sqlite3/sqlite3/lastinsertrowid.xml · from the official PHP manual (php/doc-en)