I have a script that uses a loop (specifically "while") to produce many rows of data based on various rows of data in a SQL database. This script also produces a form within the outputted row. So that it ends up looking like this:

When users click the submit button it processes the data on a new page (ratinghandler.php).
That page will then change the a value in the associated SQL database.
My question is: if each row of output in the original page corresponds to a different row in the SQL database which is referencable by the "id" value of that row. How can I associate the form with the correct "id" variable. Is it possible to tell a form to post data which was not selected by the form operator (i.e. website user)? How can i tell the page ratinghandler.php which row the submitted form corresponded to, if the forms are generated as part of a loop?
I hope I was clear I am happy to answer questions.