Posted by Jason Wong on 07/01/05 00:17
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
[Back to original message]
|