PHP 8.3.4 Released!

SQLite3::lastInsertRowID

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

SQLite3::lastInsertRowIDVeritabanına en son yerleştirilen satırın kimliğini döndürür

Açıklama

public SQLite3::lastInsertRowID(): int

Veritabanına en son yerleştirilen (INSERT) satırın kimliğini döndürür.

Bağımsız Değişkenler

Bu işlevin bağımsız değişkeni yoktur.

Dönen Değerler

Satır kimliği bir tamsayı olarak döner. Veritabanı bağlantısı boyunca hiçbir satır yerleştirilmemişse işlev 0 döndürür.

add a note

User Contributed Notes 1 note

up
36
alexofen at KEINSpamgmail dot com
9 years ago
lastInsertRowID is relative to the database connection. Hence if there are two instances of a php script (with distinct $db connections) there is no risk that the RowID of the one instance will effect the result of the other instance.

I mention this point here as it was not clear from the documentation, at least not very clear to me and hence I hope it might help others.
To Top