Re: How to get oid after table insert? [postgresql]
| From: | Joe Conway | Date: | Wed, 07 Mar 2001 15:35:00 +0000 |
| Subject: | Re: How to get oid after table insert? [postgresql] | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-42910@lists.php.net to get a copy of this message | ||
> I am working on a site using PHP (obviously) and PostgreSQL. I am
> currently using the oid as a key on a table. I would like to return the
> user to the same record after INSERTing it, but I cannot figure out how
> to get the oid of the record after doing an INSERT. Ideally, I would
> like something like:
>
> So, how do I insert a new record into the database, and get the oid of
> the record I just inserted?
>
See http://www.php.net/manual/en/function.pg-getlastoid.php
Hope this helps,
Joe