Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<SQLite3::lastExtendedErrorCodeSQLite3::loadExtension>
^SQLite3Last updated: Mon, 26 Oct 2026

SQLite3::lastInsertRowID

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

SQLite3::lastInsertRowID — Returns the row ID of the most recent INSERT into the database

Description

public function SQLite3::lastInsertRowID(): int

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

Parameters

This function has no 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.


<SQLite3::lastExtendedErrorCodeSQLite3::loadExtension>
^SQLite3Last updated: Mon, 26 Oct 2026