[quote author=anatak link=topic=123788.msg512094#msg512094 date=1169623676] Hello, Is there a function to get the value of an autoincrement (or any field) back after inserting a new row ? example INSERT INTO tbl_name (col2,col3) VALUES(firstname, lastname); col1 is an autoincrement. How can you get the value of col1 of the new row back ? kind regards anatak [/quote] Have a look at [code]SELECT LAST_INSERT_ID()[/code] You don't have to return the entire table (?!?), and it's connection based, so you don't have to worry about race conditions. Check the documentation at [url=http://href=http://dev.mysql.com/doc/refman/5.0/en/information-functions.html]href=http://dev.mysql.com/doc/refman/5.0/en/information-functions.html[/url], about halfway down the page.