hello. My situation is that I want to update the database table for the checkbox input with value “1” if the user tick the checkbox.
The value can be sent to the database, but it cannot specify the certain row for updating. Each time when I click the checkbox in row1, all the rows’s checkbox column is updated with the value 1. How should I modify so that it only update the rs(“ID”) 's row checkbox then?
Thanks in advance and wait for reply!!
administrator_ky.asp
------------------------------------------------
<form name="confirm" method="post" action="administrator_ky.asp">
<% Dim rs,conn
Set conn=Server.createObject("ADODB.Connection")
conn.open "Project"
set rs=Server.CreateObject("ADODB.recordset")
sql="select * from Tshirtproduct "
rs.Open sql,Conn
do until rs.EOF
%>
<table>
<tr>
<td><div align="center"><font color="#00CCFF" size="2" face="Verdana, Arial, Helvetica, sans-serif">
<%response.write(rs("logotype"))%>
</font></div></td>
<td><div align="center"><font color="#00CCFF" size="2" face="Verdana, Arial, Helvetica, sans-serif">
€
<%response.write(rs("totalprice"))%>
</font></div></td>
<td><div align="center"><font color="#00CCFF" size="2" face="Verdana, Arial, Helvetica, sans-serif">
<input name="kymitex" type="checkbox" value="1"
<% conn.execute "update Tshirtproduct set kymitex='"& kymitex &"'" ---when we click the first checkbox, all the
------------ rows' checkbox updated with value 1 in the database table!!!!!
If rs("kymitex")="1" then
Response.write("Checked")
end if
%> >
</font></div></td>
<%rs.MoveNext%>
</tr>
<%loop
rs.close
conn.close
%>
</table>
</form>