paragonie/easydb

Last Insert ID?

ritziyap opened this issue · 2 comments

Anyone knows how to get the LAST INSERT ID?

$db->getPdo()->lastInsertId()

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.)