Getting the value of an auto-increment

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I'm using an auto-increment field in a table as the primary key.  What I
want to know is when I use an INSERT query to add a row to the table is
there a way I can get the value of the auto-increment field of the row
that was just inserted?

What I'm currently doing is messy but works:
I get the current time and session id and write them to one of the fields
in the row and INSERT that.  I then do a query and find the row (thus
getting the value of the auto-increment field) and then write the real
data.

I'm just hoping there's an easier way.

Thanks in advance,

Tim Coombes
Komrades Ink.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux