On an ASP page I am looping through a table in a MYSQL database, which is retrieving a subproduct number based on a product number in the table. What gets outputted on the page in a form is buttons labeled "Rent Disc 1" "Rent Disc 2" "Rent Disc 3". When a button is clicked on, I want the corresponding subproduct number to be passed to the next page. The problem is I do not know how to properly save the subproduct number in a variable each loop through. What is the best way to save it, to be able to pass it to the next page?? The following code does not work:
Thanks in advance.
Code:
Set rsRentalSets = Conn222.Execute("SELECT rentalsets.productID, rentalsets.subproductID, rentalsets.description, products.productName, products.productID " & _
"FROM rentalsets, products WHERE rentalsets.productID = '" & intProdID & "' AND rentalsets.productID = products.productID AND rentalsets.rental = 'Y' ")
i=0
strSubNO = rsRentalSets.subproductID
While Not rsRentalSets.EOF
if rsRentalSets.EOF then
else
strDesc = rsRentalSets("description")
strName = rsRentalSets("productName")
strSubProductID = rsRentalSets("subproductID")
response.write "<br>" & strName & " - " & strDesc & "<br>"
%>
<form action="[URL unfurl="true"]http://xxxxxxxxxxxxxxx.asp"[/URL] method="post" id="form" name="form">
<%
strSubNO(i) = strSubProductID
%>
<input type='text' name='passMovie(i)' value='<%= strSubNO(i) %>'>
<input type='submit' value='Rent Now' id='Rent' name='Rent'>
</form>
<%
end if
i = i + 1
rsRentalSets.MoveNext
Wend
Thanks in advance.