brittny85 Posted June 29, 2006 Share Posted June 29, 2006 I am working on a project in which I use multiple forms to get data in a MySQL table. I want to get the id out of a data row as I am inputting other data into it. Using multiple html forms I will insert the other data but the id is auto-incremented and used as a primary key. However on the following pages I will need that id so that all of the data is input in the same row. Is there a way I can get that id so that I can use it later? Link to comment https://forums.phpfreaks.com/topic/13237-saving-values-during-input/ Share on other sites More sharing options...
jworisek Posted June 30, 2006 Share Posted June 30, 2006 well you can use this code immediately after submitting the data...[code]"SELECT last_insert_id() as id_number from table_name";[/code]and then save that ID in either a hidden form field or a session variable. Link to comment https://forums.phpfreaks.com/topic/13237-saving-values-during-input/#findComment-51276 Share on other sites More sharing options...
brittny85 Posted June 30, 2006 Author Share Posted June 30, 2006 Perfect! That's exactly what I was looking for!! Thank you soo much. I knew it would be something that was probably that simple, I just didn't know where to find it. Thanks again!!-Brittny ;D Link to comment https://forums.phpfreaks.com/topic/13237-saving-values-during-input/#findComment-51347 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.