Hi,
How can I after using:
$model->save()
Get the last inserted row id?
Thanks,
J
Hi,
How can I after using:
$model->save()
Get the last inserted row id?
Thanks,
J
Yii::app()->db->lastInsertID;
Just did a quick search (which i should have done before!)
You can get the last inserted id if you are using an Active Record by:
$model->id