last insert id with zend db table abstract
you can use lastInsertId Method
echo 'last inserted id: ' . $db->lastInsertId();
use after insert query
$this->dbAdapter->getDriver()->getLastGeneratedValue();
try
$id = $tablemodel->insert($data);
echo $id;
$last_id = $tablemodel->getAdapter()->lastInsertId();