Last Insert ID?
ritziyap opened this issue · 2 comments
ritziyap commented
Anyone knows how to get the LAST INSERT ID?
Deleted user commented
$db->getPdo()->lastInsertId()
paragonie-security commented
You can short-circuit this by just saying $db->lastInsertId()
.
Alternatively, you can use insertGet()
to select the auto-generated value for a given column at insert time in one API call. (Some database drivers don't support lastInsertId()
correctly.)