dim Action,ID,VoteType,VoteOption,arrOptions,sqlVote,rsVote
dim Voted,VotedID,arrVotedID,i
dim FoundErr,ErrMsg
VoteOption=trim(request("VoteOption"))
if instr(VoteOption,",")>0 then
arrOptions=split(VoteOption,",")
for i=0 to ubound(arrOptions)
conn.execute "Update Vote set answer" & cint(trim(arrOptions(i))) & "= answer" & cint(trim(arrOptions(i))) & "+1 where id=4"
next
else
conn.execute "Update Vote set answer" & VoteOption & "= answer" & VoteOption & "+1 where id=4"
end if
if err then
response.Write("<script language=javascript>alert('保存失败');location='试验.asp';</script>")
else
response.Write("<script language=javascript>alert('保存成功');location='试验.asp';</script>")
end if
上一页是:
<form action="shiyan_vot.asp" method="post">
<table width="200" border="1">
<tr>
<td><input name="VoteOption" type="checkbox" value="1" />123</td>
</tr>
<tr>
<td><input name="VoteOption" type="checkbox" value="2" />143</td>
</tr>
<tr>
<td><input name="VoteOption" type="checkbox" value="3" />444</td>
</tr>
<tr>
<td><input name="VoteOption" type="checkbox" value="4" />555</td>
</tr>
<tr>
<td><input name="VoteOption" type="checkbox" value="5" />666</td>
</tr>
<tr>
<td><input name="" type="submit" /></td>
</tr>
</table>
</form>
如果FORM中没选的话,是怎么剔除的。上面的代码是怎么遍历数组的,那些是数组的内容,例:(内容1,内容2);那些是数组的排名(第一字段,第二字段),最好详细点,怎么进数据库的,能多说就多说点,详细的有加分 ,提示answer1、2、3是数据库里计数的字段,选择了就加1