I have ID set to auto increment but after adding a row of data i want to get back into the variable the id of that row which i can then use. How do i do that?

I can see how it is done in the tutorial on mysql and php but that is after going through each record, i only want it for the one i have just added.