That works ! so, why lastInsertId() returns 0 ? and why does it work with insert(), but not with save() ?
is $row->id() same as lastInsertId() / My main concern is that I don't want to get just the last ID from the table, but the actual ID from the row just added. I guess ZF deals with this as expected. On Tue, Mar 2, 2010 at 10:06 PM, David Muir [via Zend Framework Community] <[email protected]> wrote: > If all you're after is the id of the row, just get it from the row: > > $row->save(); > $id = $row->id; > > Save should be returning the primary key, and if not, then it's a bug. > > Cheers, > David > > > > ________________________________ > View message @ > http://n4.nabble.com/insert-or-save-Zend-Db-Table-tp1575952p1576111.html > To unsubscribe from insert() or save() Zend_Db_Table, click here. > -- Roberto Flores Departamento de Informática [email protected] MEX: 638-40-80 USA: (714)-380-30-29 -- View this message in context: http://n4.nabble.com/insert-or-save-Zend-Db-Table-tp1575952p1576129.html Sent from the Zend Framework mailing list archive at Nabble.com.
