-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

$id = $db->insert('my_table', $data);
...................................
:  ___   _   ___ ___ ___ _ ___    :
: |   \ /_\ / __| _ \ _ (_)   \   :
: | |) / _ \\__ \  _/   / | |) |  :
: |___/_/:\_\___/_| |_|_\_|___/   :
:........:........................:
: Web    : http://www.dasprids.de :
: E-mail : [email protected]       :
: Jabber : [email protected]     :
: ICQ    : 105677955              :
:........:........................:


debussy007 schrieb:
> Hello,
> 
> When I insert a record in a table like $db->insert('my_table', $data); I
> would like to get the new id generated.
> ($db is the Db Adapter)
> 
> What is the best way to achieve this ?
> 
> When I was using Zend_Db_Table_Abstract I just had to do return
> $myTable->insert ... and the insert method would return the new id.
> 
> However the insert method of the Zend_Db_Adapter_Abstract won't return the
> new id but the number of rows affected (which will always be 1 I guess ...)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkpiNCsACgkQ0HfT5Ws789DdbACgjJUBZRdafwHoq5XIreIyR7H5
q3wAoKEg7RF0tiIuBP04VMRwZ6bqglN/
=rcYA
-----END PGP SIGNATURE-----

Reply via email to