We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 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