asp中的复选框表单提交后怎么用 select XX from XX in 查询
表单代码<tronMouseOver="this.bgColor='#F0F7FF'"onMouseOut="this.bgColor='#FAFAFA'"><tdcol...
表单代码
<tr onMouseOver="this.bgColor='#F0F7FF'" onMouseOut="this.bgColor='#FAFAFA'">
<td colspan="4">
<table width="96%" cellpadding="0" cellspacing="5" align="center">
<tr>
<td width="24%"><%=rs("jh")%></td>
<td width="24%"><%=rs("xm")%></td>
<td width="24%"><%=rs("ksyh")%></td>
<td >
<label>
<input type="checkbox" name=xzksy value=<%=rs("jh")%>>
</label></td>
</tr>
</table>
查询代码
kc =trim(request.form("kc")) '接收考场信息
xzksy =trim(request.form("xzksy")) '接收考试员id
' response.write xzksy
Set rs = Server.CreateObject( "ADODB.Recordset" )
sql = "select * from kaoshiyuan where jh in " & "(" & xzksy & ")"
' response.write sql
rs.open sql,conn,1,3
通过打印发现提交过来的字符里都缺少 ' 不知怎么加上,或别的什么办法 展开
<tr onMouseOver="this.bgColor='#F0F7FF'" onMouseOut="this.bgColor='#FAFAFA'">
<td colspan="4">
<table width="96%" cellpadding="0" cellspacing="5" align="center">
<tr>
<td width="24%"><%=rs("jh")%></td>
<td width="24%"><%=rs("xm")%></td>
<td width="24%"><%=rs("ksyh")%></td>
<td >
<label>
<input type="checkbox" name=xzksy value=<%=rs("jh")%>>
</label></td>
</tr>
</table>
查询代码
kc =trim(request.form("kc")) '接收考场信息
xzksy =trim(request.form("xzksy")) '接收考试员id
' response.write xzksy
Set rs = Server.CreateObject( "ADODB.Recordset" )
sql = "select * from kaoshiyuan where jh in " & "(" & xzksy & ")"
' response.write sql
rs.open sql,conn,1,3
通过打印发现提交过来的字符里都缺少 ' 不知怎么加上,或别的什么办法 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询