From: Jules Alberts <jules.alberts@arbodienst-limburg.nl>
To: pgsql-php@postgresql.org
Subject: AdoDB: how to determine OID of inserted row with Execute()
Date: Tue, 24 Dec 2002 13:57:24 +0100
Message-ID: <200212241257.gBOCvk2C012966@artemis.cuci.nl> (raw)
Hello everyone,
I'm using AdoDB to create a PHP interface to a PostgreSQL db. I have a
problem when inserting a row. I do something like this:
connect_to_db();
$return = $db->Execute("insert into foo values ('bar'));
if ($return === false) {
echo $db->ErrorMsg();
} else {
show_row($oid) // here's the problem
}
When I do a succesful INSERT in pgsql, the OID of the inserted row is
echoed. However, according to the manual, the Execute() method allways
returns a recordset. I did a serialize() on $return to see if the OID
is there somewhere, but it isn't. I need the OID to be able to display
the row (with show_row()) after it's inserted.
Does anybody know how to determine the OID of an INSERTed row when
using AdoDB? TIA!
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: jules.alberts@arbodienst-limburg.nl
Subject: Re: AdoDB: how to determine OID of inserted row with Execute()
In-Reply-To: <200212241257.gBOCvk2C012966@artemis.cuci.nl>
References: <200212241257.gBOCvk2C012966@artemis.cuci.nl>
* 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