pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Stanaway <david@stanaway.net>
To: Zhidian Du <zdu@cs.nmsu.edu>
Cc: pgsql-php@postgresql.org
Subject: Re: ResultSetMetaData  in PHP?
Date: 28 Aug 2002 23:05:19 -0500
Message-ID: <1030593919.22999.25.camel@ciderbox> (raw)
In-Reply-To: <3D6C259C.6060008@cs.nmsu.edu>
References: <3D6C259C.6060008@cs.nmsu.edu>

On Tue, 2002-08-27 at 20:21, Zhidian Du wrote:
> I am just use PHP.  I have two questions:
> 
> 1. When I use OID, how can I get a current OID and lock it and use it 
> before I insert a record, as nextval(..) does, in PHP?  

I am not sure that you can get this in advance, but you can get the oid
after an insert/update.

http://www.php.net/manual/en/function.pg-last-oid.php
for PHP 4 >= 4.2.0

otherwise: pg_getlastoid()

See:
http://www.php.net/manual/en/ref.pgsql.php

 
-- 
David Stanaway



view thread (3+ messages)

Message-ID: <1030593919.22999.25.camel@ciderbox>
Permalink:  ../1030593919.22999.25.camel@ciderbox/
Also on:    postgresql.org/message-id/1030593919.22999.25.camel@ciderbox

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: david@stanaway.net, zdu@cs.nmsu.edu
  Subject: Re: ResultSetMetaData  in PHP?
  In-Reply-To: <1030593919.22999.25.camel@ciderbox>
  References: <3D6C259C.6060008@cs.nmsu.edu> <1030593919.22999.25.camel@ciderbox>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox