Re: postgres - mysql last_inserted_id

From: Date: Thu, 30 Jun 2005 21:17:16 +0000
Subject: Re: postgres - mysql last_inserted_id
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-217912@lists.php.net to get a copy of this message
On Friday 01 July 2005 04:06, Richard Lynch wrote: > > last > > record from the tabel, for linking to another tabel. > > You have to use http://php.net/pg_last_oid to get the > PostgreSQL > "internal" Object ID (OID) -- You can then use the ubiquitous "oid" > column. > > > $query = "insert ..."; > pg_exec($connection, $query); > $oid = pg_last_oid($connection); I'm pretty sure I read somewhere that the the "last OID" can get messed up under some circumstances and the OID that you get is not the OID that you want. Can't remember whether this was a php-postgresql thing or simply a postgresql thing. But whatever it is, you don't need OIDs to use sequences. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * ------------------------------------------ Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general ------------------------------------------ New Year Resolution: Ignore top posted posts

« previous php.general (#217912) next »