hello
i want to update some records in the database by using checkboxes.
I wrote a code but it didn't work proparly. It update whole records not only the selected one by the checkbox. how can i do that????
this is my code
While ((Repeat1__numRows <> 0) AND (NOT rsAnswer2.EOF))
%>
<tr valign="baseline">
<td nowrap align="right"></td>
<td valign="top">
<input type="checkbox" name="answers" value="<%=(rsAnswer2.Fields.Item("answer_no").Valu e)%>" >
<option value="<%=(rsAnswer2.Fields.Item("answer_no").Valu e)%>"><%=(rsAnswer2.Fields.Item("answers").Value)% ></option> </td>
<td valign="top"><%=(rsAnswer2.Fields.Item("counts").V alue)%></td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsAnswer2.MoveNext()
Wend
%>
update page:
<%
set cmdUpdateAns = Server.CreateObject("ADODB.Command")
cmdUpdateAns.ActiveConnection = MM_srcsurvey_conn_STRING
cmdUpdateAns.CommandText = "UPDATE answers SET counts = counts + 1 WHERE answer_no= " & request.querystring("answers")
cmdUpdateAns.CommandType = 1
cmdUpdateAns.CommandTimeout = 0
cmdUpdateAns.Prepared = true
cmdUpdateAns.Execute()
%>