0

What's the best way to do this?

Note that this is the sqlite version packaged with Google Gears, also.

Hamster
  • 529
  • 2
  • 7
  • 12

1 Answers1

0

This post has details of getting the value of the auto increment key in sqlite. Is that what you are after?

Community
  • 1
  • 1
Andy Robinson
  • 6,975
  • 2
  • 28
  • 20
  • Close, but this is Javascript running Google Gears. Is this what I need: http://code.google.com/apis/gears/api_database.html#Database-lastInsertRowId ? – Hamster Jul 07 '10 at 08:52
  • Yeah that looks like it will work. Here's a post, http://blog.brianflove.com/articles/2008/07/14/google-gears-presentation/, with some example code running with gears, doing and insert and getting the id using lastInsertRowId. db.execute('insert into Users (firstname, lastname, Description, Timestamp) values (?, ?, ?, ?)', [$F('firstname'), $F('lastname'), $F('Description'), new Date().getTime()]); lastid = db.lastInsertRowId; – Andy Robinson Jul 07 '10 at 09:44