I want to clear my understanding about the following command :
Yii::app()->db->getLastInsertId() ;
Does it retrieve the last insert for this particular user or connection ? And in Yii if I am using Yii::app()->db for db connections throughout can it not interfere with other users ?
Does this command retrieve the last insert id for the particular user or the most recent insert irrespective of the user .
Yii::app()->db->getLastInsertId()
uses function last_insert_id
. This refers to the last ID created using current database connection. The generated ID is maintained in the server depend on connections. It means the return value would be of most recent statement by that request. This value would not be affected by another requests.