jaym
jaym

Reputation: 470

fetching last inserted id on Zend

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

Answers (1)

Related Questions