last mysql transaction...

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
silent assassin
Forum Newbie
Posts: 13
Joined: Mon Feb 27, 2006 6:53 pm

last mysql transaction...

Post by silent assassin »

Hey guys, here's my problem. Not a big one, but for some reason, I just can't wrap my head around it.

I'm doing a customer database, and after inputting their data, I need to have a link on the page that lets me do something with their data. Here's the case in point.


I get their name, addres, etc, etc, on a page, and they submit the form. The page they submit the form to throws their information into a database, and then renders a page that says, hey, thanks for entering your information, would you like to click on LINK to modify your information?

So, to make the link work, I need the id (primary index, key field value) of the data insert I just did. Can anyone tell me how to get that information without comparing the actual data? (eg, name, address, etc, etc)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

unless concurrency issues arrise, mysql_insert_id() can be used.
Post Reply