Basically I have a table that is being used to display data from an sql table.
Each row in the database is looped through so each row in the database is also displayed on a new row in the html table.
I have a submit button included in the loop which is displayed in the last column of each row.
What I want is when one of the submit buttons are pressed, the data on that specific row is stored and the displayed on the next page which is the forms action.
I’m not sure if this is possible the way I have done it or if I need a unique identifier for each submit button.
Any help would be appreciated 🙂
well each row in the sql should have a unique identifier, use this identifier to distinguish which row of the html table that the user selected.
simply, on the submit button have a post or get value of that unique identifier.
When the next page is loaded, use $_GET or $_POST to recieve that unique identifier, use SQL to find the data of that row, and then display it to the html at the top of the new page.
I believe that is what you are asking. Since you didnt ask for specific code.
EDIT:
If you want to use a get, use a simple anchor: just have the id in the url
on the new page that links to, you just use
or if you want to use a post, use a form
and on the next page you get the post value through