We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

get Last Insert

Hello, How can i get the last insert record ID ? Somethink like .... $model->save() $model->getLastInsert();



98.9k
Accepted
answer

Last inserted ID is automatically assigned to the identity field, you just have to access it: $model->save() and then $model->id