---------- Forwarded message ----------
From: Sean Thayne <[EMAIL PROTECTED]>
Date: Wed, Oct 22, 2008 at 3:20 PM
Subject: Re: [UPHPU] Postgres Insert ID
To: [EMAIL PROTECTED]
Thanks, that's a bummer, wonder by Postgres doesn't have a feature like
this. Don't most database servers have a equivalent function?
On Wed, Oct 22, 2008 at 3:18 PM, thebigdog <[EMAIL PROTECTED]> wrote:
> > I'm not having any luck finding the equivalent to mysqli_insert_id() for
> > postgres. I've seen the method of getting the id from the sequence, but
> I'm
> > hoping for a better way to do then that...
>
> technically, there is not a php function in postgesql like that function.
> you
> can write a query to provide that information based on the sequence that
> you are
> using.
>
> select currval('sequence_name');
>
> that will return the last value used. however, there is not a php function
> that
> will provide the functionality that mysqli_insert_id() does.
>
> here is some additional info on it:
>
> http://archives.postgresql.org/pgsql-general/2003-08/msg01699.php
> http://www.postgresql.org/docs/8.2/static/functions-sequence.html
>
>
> --
> thebigdog
>
_______________________________________________
UPHPU mailing list
[email protected]
http://uphpu.org/mailman/listinfo/uphpu
IRC: #uphpu on irc.freenode.net