Zend Framework, MSSQL 2008 R2, PDO - & gt; insert lastInsertId?

Asked bysharonloves cookies

How to get lastInsertId if you do it in

$model-&gt;insert(array(<br/>
 'data1' =&gt; $data1,<br/>
 'data2' =&gt; $data2,<br/>
));<br/>


$ model- & gt; lastInserId (); - does not work ...

Answers

Replies:
not, this is for HP the same ... - fazilla
koshiba
php.net/manual/en/pdo.lastinsertid.php
Note:
 It is not necessary to even support the notion of auto-increment fields or sequences.

After such a notice in the documentation, the first thing that comes to mind is the need to attend to "your, reliable" tool.

as an option - a comment from php.net/manual/en/pdo.lastinsertid.php - why not a workground?

as an option, you can use another
select IDENT_CURRENT('tableName');
or
select SCOPE_IDENTITY();
after successful insertion.

well and, of course, do not forget about sessions and scope to get exactly what you need (msdn.microsoft.com/en-us/library/ms175098.aspx)
Are there any software products for organizing / indexing / searching docks in smb ball? :: Rounding in PHP :: Ubuntu Linux and USB to COM adapter cp210X driver installation? :: Organization of a multilingual forum? :: Advise foreign freelancing sites (equipment development)
Leave Repply forZend Framework, MSSQL 2008 R2, PDO - & gt; insert lastInsertId?
Useful Links