Please wait while we load your page...


PHP Manual :: sqlite_last_insert_rowid

sqlite_last_error || sqlite_libencoding || SQLite Functions || PHP Manual

(PHP 5 < 5.4.0, PECL sqlite >= 1.0.0)

sqlite_last_insert_rowid -- SQLiteDatabase::lastInsertRowidReturns the rowid of the most recently inserted row


int sqlite_last_insert_rowid ( resource $dbhandle )

Object oriented style (method):

public int SQLiteDatabase::lastInsertRowid ( void )

Returns the rowid of the row that was most recently inserted into the database dbhandle, if it was created as an auto-increment field.


You can create auto-increment fields in SQLite by declaring them as INTEGER PRIMARY KEY in your table schema.



The SQLite Database resource; returned from sqlite_open() when used procedurally. This parameter is not required when using the object-oriented method.

Return Values

Returns the row id, as an integer.

sqlite_last_error || sqlite_libencoding || SQLite Functions || PHP Manual
Live Chat Not Available