表user中有id,u_name,u_sex,u_addr等字段
uname=request("u_name")
usex=request("u_sex")
uaddr=request("u_addr")
sql="select * from user where 1=1"
if uname<>empty or len(uname)>1 then
sql=sql & " and u_name='"&uname&"'"
end if
if usex<>empty or usex<>"" then
sql=sql & " and u_sex='"&usex&"'"
end if
if uaddr<>empty or uaddr<>"" then
sql=sql & " and u_addr like %"&uaddr&"%"
end if
sql=sql & " order by id desc"