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.
PHP.mk документација
SQLite3::lastInsertRowID
Почист и полокален преглед на PHP референцата, со задржана структура од PHP.net и подобра читливост за примери, секции и белешки.
Патека
sqlite3.lastinsertrowid.php
Локална патека за оваа страница.
Извор
php.net/manual/en
Оригиналниот HTML се реупотребува и локално се стилизира.
Режим
Прокси + превод во позадина
Кодовите, табелите и белешките остануваат читливи во истиот тек.
Референца
sqlite3.lastinsertrowid.php
SQLite3::lastInsertRowID
Референца за `sqlite3.lastinsertrowid.php` со подобрена типографија и навигација.
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
= NULL
Returns the row ID of the most recent INSERT into the database.
Параметри
Оваа функција нема параметри.
Вратени вредности
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.
Белешки од корисници 1 белешка
alexofen at KEINSpamgmail dot com ¶
пред 11 години