c1t1z3n Posted August 17, 2009 Share Posted August 17, 2009 i have setup a database table with the fields id (int auto_increment) and data (varchar) and am using the following to add records to the database: $q = "INSERT INTO database_table ('data') VALUES ('$data')"; $result = mysql_query($q); how do i determine which value the auto_increment column (id) was given when the database was updated? Quote Link to comment https://forums.phpfreaks.com/topic/170664-solved-retrieving-auto_increment-info/ Share on other sites More sharing options...
Maq Posted August 17, 2009 Share Posted August 17, 2009 You can use mysql_insert_id. All the information you need is in the manual link. Quote Link to comment https://forums.phpfreaks.com/topic/170664-solved-retrieving-auto_increment-info/#findComment-900114 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.