Reputation: 470
I would like to ask how would i know the last inserted id of a record inserted to a table. I am using a Zend_Db_Table_Abstract;
$stuff = new Application_Model_MyStuff_NewStuff();
$stuff->createMyStuff($id = 1, $stuff = "This is a new stuff!");
//when i try to see what id is inserted using this code;
echo $stuff->getAdapter()->lastInsertId();
//it shows a continuous incremented value instead of the actual 'id' field value.
Thanks. Happy coding!
Upvotes: 0
Views: 404
Reputation: 470
I just got it,
http://osdir.com/ml/php.zend.framework.db/2008-04/msg00008.html
Upvotes: 2