ASP多关键字检索

sql=" 1=1"
if instr(key," ")<>0 then
str = split(key," ")
for i=0 to ubound(str)
sql = sql&" and title like'%"&str(i)&"%'"
next
strSQL="select * from gb where status='5' and "&sql&" order by pubdate desc"
else
strSQL="select * from gb where status='5' and title like '%"&key&"%' or keyword like '%"&key&"%' order by pubdate desc"
end if
posted on 2008-07-16 16:30  草原和大树  阅读(369)  评论(0编辑  收藏  举报