Jump to content


Photo

Saving Values During Input


  • Please log in to reply
2 replies to this topic

#1 brittny85

brittny85
  • Members
  • PipPip
  • Member
  • 23 posts
  • LocationUtah

Posted 29 June 2006 - 06:52 PM

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?

#2 jworisek

jworisek
  • Members
  • PipPipPip
  • Advanced Member
  • 112 posts

Posted 30 June 2006 - 03:25 PM

well you can use this code immediately after submitting the data...

"SELECT last_insert_id() as id_number from table_name";

and then save that ID in either a hidden form field or a session variable.

#3 brittny85

brittny85
  • Members
  • PipPip
  • Member
  • 23 posts
  • LocationUtah

Posted 30 June 2006 - 05:26 PM

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users