开发者

fetching last inserted id on Zend

开发者 https://www.devze.com 2023-02-02 23:48 出处:网络
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;

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 Applicati开发者_运维知识库on_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!


I just got it,

http://osdir.com/ml/php.zend.framework.db/2008-04/msg00008.html

0

精彩评论

暂无评论...
验证码 换一张
取 消