#22003/3/13 11:15:43
用where的子语句查询喽,你这样太占资源了。
这是我写的,你拿去改一下吧。
<%
dim rs,sql
set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from u_masg where u_type='"&u_type&"'"
if u_ye<>"" or u_ye<>"按行业查询" then
sql=sql & " and u_ye like '%"& u_ye &"%'"
end if
if u_xue<>"0" then
sql=sql & " and u_xue='" & u_xue & "'"
end if
if u_body<>"" then
sql=sql & " and u_title like '%"&u_body&"%' "
end if
if u_time<>"00" then
sql=sql & " and u_time>='" & dateadd("d",-cint(u_time),date()) & "'"
end if
sql=sql & " order by id desc"
rs.open sql,cn,1,1
if rs.recordcount<1 then
response.write "
暂时还没有你要查询的信息"
else
……
end if
%>
难人一个……