lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Jun 2, 2010, at 7:47 PM, Luciano de Souza wrote:

> db ='test.dbl')
> print(db:last_insert_rowid())
> The last rowid is undoubtedly 6, but I receive 0 as an answer.


> This routine returns the rowid of the most recent successful INSERT into the database from the database connection in the first argument. If no successful INSERTs have ever occurred on that database connection, zero is returned.

Since db (the database connection) was just opened, 0 is the expected answer.

Perhaps you should try executing the query: select max(id) from contacts;