php3-list | 200003
Date: 03/10/00
- Next message: Stephen Cope: "Re: [PHP3]Refresh two frames in a window in a single click."
- Previous message: plummerk <email protected>: "Re: [PHP3] what to do ???"
- Next in thread: Jouni Ahto: "Re: [PHP3] PostgreSQL Object ID from INSERT"
- Reply: Jouni Ahto: "Re: [PHP3] PostgreSQL Object ID from INSERT"
- Maybe reply: Peter Mount: "RE: [PHP3] PostgreSQL Object ID from INSERT"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi,
I've set up a table in PostgreSQL using a serial SEQUENCE as a primary
key.
Using PHP, I insert information into the database by using:
$result = pg_exec ($database, "INSERT INTO.... ;");
where $database is the database in question, and all information except
the field for the serial SEQUENCE is inserted.
What I need to do now is to be able to now do a SELECT on that new
entry, so I can get the number that PostgreSQL has assigned for the
SEQUENCE.
I know I can use:
$oid = pg_getlastoid ($result);
to get the Object ID of the last INSERT that was done, but I am not
clear on how I can use $oid to now select the SEQUENCE field from that
recently inserted row.
Ideas?
TIA,
--Andrew Hill
-- PHP 3 Mailing List <http://www.php.net/> To unsubscribe, send an empty message to php3-unsubscribe <email protected> To subscribe to the digest, e-mail: php3-digest-subscribe <email protected> To search the mailing list archive, go to: http://www.php.net/mailsearch.php3 To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Stephen Cope: "Re: [PHP3]Refresh two frames in a window in a single click."
- Previous message: plummerk <email protected>: "Re: [PHP3] what to do ???"
- Next in thread: Jouni Ahto: "Re: [PHP3] PostgreSQL Object ID from INSERT"
- Reply: Jouni Ahto: "Re: [PHP3] PostgreSQL Object ID from INSERT"
- Maybe reply: Peter Mount: "RE: [PHP3] PostgreSQL Object ID from INSERT"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

