Jump to content

Archived

This topic is now archived and is closed to further replies.

brittny85

Saving Values During Input

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.