多项删除

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>

<!--#include file="conn.asp"-->
<%
set rs=server.CreateObject("adodb.recordset")
sql="select * from class order by date desc"
rs.open sql,conn,1,1
if rs.eof then
response.Write("没有班级")
response.end
end if

%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css/fe.css" rel="stylesheet" type="text/css">
</head>
<script >
function yesno()
  {
    return confirm("将会把所有成员及留言信息删除,您确定要删除该班级吗?");
  }
  </script>

<body leftmargin="0" topmargin="0">


<table width="500" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="50" height="20" align="center">I D</td>
<td height="20" align="center">班 级 名 称</td>
<td width="100" height="20" align="center">注 册 日 期</td>
<td height="20" align="center">人 数</td>
<td align="center">删 除?</td>
</tr>
<%
while not rs.eof
%>
<form name="form2" method="post" action="dec.asp"><tr>
<td width="50" height="20" align="center">
<input type="checkbox" name="id" value="<%=rs("classid")%>">
</td>
<td width="250" height="20" align="center"><%=rs("classname")%></td>
<td width="100" align="center"><%=rs("date")%></td>
<td width="50" height="20" align="center"><%=rs("num")%></td>
<td width="50" height="20" align="center"></td>
</tr><%rs.movenext
wend
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
<tr>
<td height="20" align="center"> </td>
<td height="20" align="center"> </td>
<td align="center"> </td>
<td height="20" align="center"> </td>
<td height="20" align="center">
<input type="submit" name="Submit" value="删除"></form>
</td>
</tr>

</table>

</body>
</html>

dec.asp


<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp"-->
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body>
<%
sql= "DELETE FROM class WHERE classid IN (" & Request.Form("id") & ")"
conn.execute (sql)%>
</body>
</html>
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值