last insert id with zend db table abstract

Santosh Linkha picture Santosh Linkha · Jan 30, 2011 · Viewed 43.2k times · Source

variable $tablemodel in an instance of a model which extends Zend_Db_Table_Abstract, if i do

$tablemodel->insert($data)

to insert data. Is there any method or property to get last insert id?

regards

Answer

Haim Evgi picture Haim Evgi · Jan 30, 2011

try

$id = $tablemodel->insert($data);  
echo $id;