php教程

SQLite3::lastInsertRowID

(PHP 5 >= 5.3.0, PHP 7)

SQLite3::lastInsertRowIDReturns the row ID of the most recent INSERT into the database

说明

public SQLite3::lastInsertRowID ( void ) : int

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

参数

此函数没有参数。

返回值

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

User Contributed Notes

alexofen at KEINSpamgmail dot com 05-Jan-2015 10:08
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.

CopyRight © 2008-2022 verySource.Com All Rights reserved. 京ICP备17048824号-1 京公网安备:11010502034788