Database tables often have an auto-increment field that acts as primary key. Sometimes it is necessary to retrieve this field immediately, for instance when adding a related entry to another table in the database. Fortunately, Zend_Db_Table offers a simple way to access this field, as it is passed back as the return value from the insert function. For instance:
$id = $dbTable->insert($data);
The variable $data is an array containing the values of the record to insert as key-value pairs. It should not include the primary key if the field is auto-increment.