Hi There

The manual suggests that you should not rely on the result of insert()
method for last inserted id:

"13.1.4.2. Retrieving a Generated Value
Some RDBMS brands support auto-incrementing primary keys. A table defined
this way generates a primary key value automatically during an INSERT of a
new row. The return value of the insert() method is not the last inserted
ID, because the table might not have an auto-incremented column. Instead,
the return value is the number of rows affected (usually 1)."

However whenever I make use of insert() I always retrieve the id as return
value of insert() e.g.

$data = array('name'=>'tom');
$id = $table->insert($data);

And have never had a problem, am I missing something here?

Cheers

Tom
-- 
View this message in context: 
http://www.nabble.com/last-insert-id-clarification-tp21505652p21505652.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to