[Quote=引用 5 楼 sunsbn 的回复:]
引用 3 楼 sy_binbin 的回复:
title = request("title")
sql = "select * from info where class_id=1 and title = '"&title&"'"
rs.open sql,conn,1,1
if not(rs.bof and rs.eof) then
response.write "重复了"
else
response.write "没重复"
end if
是这个意思不
dim classid,title
classid=request.form("classid")
title=request.form("title")
set rs=server.CreateObject("adodb.recordset")
sql="select * from info where title='"&title&"' and classid="&classid
sql2="insert into info(title,classid) values('"&title&"',"&classid&")" '此处为你要做的操作
rs.open sql,conn,1,1
if not rs.eof then
response.Write("已经存在")
else
rs.open sql2,conn,1,2
end if%>[code=code]
select class_id,name from info where class_id in(select distinct id from class) group by class_id,name having count(*)=1 order by class_id
name是info中内容字段,这样查出来的是没有重复的。
[Quote=引用 3 楼 sy_binbin 的回复:]
title = request("title")
sql = "select * from info where class_id=1 and title = '"&title&"'"
rs.open sql,conn,1,1
if not(rs.bof and rs.eof) then
response.write "重复了"
else
response.write "没重复"
end if
是这个意思不
[/Quote]
title = request("title")
sql = "select * from info where class_id=1 and title = '"&title&"'"
rs.open sql,conn,1,1
if not(rs.bof and rs.eof) then
response.write "重复了"
else
response.write "没重复"
end if
是这个意思不