Hi All,
I just wanted to know is there any alternate option available in Yii that can work the same as mysql_insert_id i.e which can tell the latest inserted id in any particular table
Regards
Hi All,
I just wanted to know is there any alternate option available in Yii that can work the same as mysql_insert_id i.e which can tell the latest inserted id in any particular table
Regards
If you use CActiveRecords models… after the $model->save() you just read the value of the primary key filed… like
$pkvalue=$model->id;
Edit:
and there is lastInsertID - http://www.yiiframework.com/doc/api/1.1/CDbConnection#lastInsertID-detail
thnx