tags:

views:

78

answers:

2

Hi

after an insert I need to know the ID from this row, how can I do that?

A: 

According to the Dataset#insert documentation, the return value for insert() is usually the primary key of the inserted row, but it depends which adapter you're using.

Greg Campbell
A: 

Thanks!

I use the MySQL adapter and this works:

last_id = table.insert({...})
xaver23