Insert record into MySQL and get auto_increment back out again in same PHP file
Posted on 2004-10-05
I have a form which adds records to 2 separate tables, the second keeps track of updates that are done to the first. In the first, the primary key is just an auto_increment integer, but int he second, I need to specify that number so that the update is assocated with the right record in the first table. So after the record is inserted into the first table, how can I get that auto_increment value back out for that record? I could just use the highest number in that column, but that wouldn't necessarially be correct.
can anybody help at all?