Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to access primary key, from last insert.

Status
Not open for further replies.

dwessell

Programmer
Jan 26, 2006
114
US
Hi all..

I'm making a series of inserts into a MySQL DB.. The inserts occur across a few different tables..

For example, I make an insert into a table called 'UserInformation'. UserInformation has a Primary Key that auto increments. So when I insert the other colums into that table, the primary key will be generated for me.

After I have made the insert into that table, how can I find out what the Primary Key (In my case UID) was that was assigned?

Thanks
David
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top