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
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