SQLite autoincrement FAQ: How do I get the autoincrement value from my last SQLite INSERT command?
You can get the integer value of the primary key field from the last insert into an autoincrement field using a SQLite function named last_insert_rowid(), as shown here.