Re: [Phplib-users] Add db feature ?
Brought to you by:
nhruby,
richardarcher
From: nathan r. h. <na...@ds...> - 2001-08-26 14:40:09
|
On Sun, 26 Aug 2001, Guillaume Desclaux wrote: > Hi, > > I know the function nextid($seq_name) in db class exists... but many > databases implement their own sequence mechanism (like auto_increment in > mysql, or sequence in Oracle, etc...) > So, don't you think that we should add the function insert_id() in db > class to retrieve easily the id generated by a query INSERT into table > where the table key id is auto_increment ? > That's a MySQL specfic thing. If you feel like it, you can add a method last_id() for each DB class and use whatever native calls it takes to get it, or emulate it if possible. In reaility, db_sequence makes a whole lot more sense for db portability and atomic operation. -n -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- nathan hruby / digital statement na...@ds... http://www.dstatement.com/ Public GPG key can be found at: http://www.dstatement.com/nathan-gpg-key.txt ED54 9A5E 132D BD01 9103 EEF3 E1B9 4738 EC90 801B -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- |