Hi,

  You can use  the LAST_INSERT_ID() function to find out the page_id for
the inserted row.

   $query="select LAST_INSERT_ID() as page_id ";

HTH
Sorin Ifrim


----- Original Message -----
From: phobo <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, February 18, 2001 2:14 PM
Subject: [PHP-DB] How do i find MySQL inserted primary key?


> if i do an insert statement where i let MySQL assign the
(autoincrementing)
> primarykey, how do i find out the primary key of the record i just
inserted?
>
> siggy
>
> ----- Original Message -----
> From: "Thies C. Arntzen" <[EMAIL PROTECTED]>
> To: "Brian Lalor" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Monday, February 19, 2001 1:02 AM
> Subject: Re: [PHP-DB] OCI8 error problems
>
>
> > On Thu, Feb 15, 2001 at 10:07:23AM -0500, Brian Lalor wrote:
> > > On Thu, 15 Feb 2001, Thies C. Arntzen wrote:
> > >
> > > >     how should it?
> > > >
> > > >     you would have to pass in the correct statement|connection
> > > >     handle - elsewise it simply won't work!
> > >
> > > Ok, that was a cobbled-up code snippet; replace $this->conn with
$conn,
> > > and $statement with $s.
> > >
> > > It still doesn't work...
> >
> > <?
> > $db = ocilogon('tc','tc');
> > $stmt = ociparse($db,"insert into uni values (1)");
> > $success = @ociexecute($stmt);
> > if (! $success) {
> > var_dump(ocierror($stmt));
> > }
> > ?>
> >
> >     works for me.
> >
> >     tc
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail:
[EMAIL PROTECTED]
> >
> >
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to