Reputation: 1388
I have a form which is submitting a number of values. When inserted into my table in my database, it creates a unique id in my database (primary key). How would I check for that same unique id on the next page that I send the form action to?
Here is my code for my form. I don't want to confuse you guys with all of my form inputs so I just put these elements here.
<form action='selectItems.php' method='post' enctype="multipart/form-data" id='tradeForm'>
<input type='submit' name='submit' value='Go to next step'></input>
</form>
Would I append the id on the form action through GET? If so, how? I would appreciate any help.
Upvotes: 0
Views: 338
Reputation: 186
Use
mysql_insert_id()
This function returns you last inserted id.
Retrieves the ID generated for an AUTO_INCREMENT column by the previous query (usually INSERT).
Upvotes: 1