支持加号空格的查询
发布时间:2016-12-29 来源:查字典编辑
摘要:复制代码代码如下:
复制代码 代码如下:
<%
Response.write"关键字:("&trim(request("Q"))&")"&"<hr>"
x=Replace(trim(request("Q")),"",",")
'x=array(x)
t=split(x,",")
SQL="Select*FromTBwherekis<>0"
fori=0toUBound(t)
ift(i)<>""then
Response.write"第"&i+1&":"&t(i)&"<hr>"
SQL=SQL&"ortitlelike'"&t(i)&"'" '这个是关键
endif
next
Response.writeSQL
%>
<Formaction="">
<table>
<tr>
<td><InputName="Q"onkeyup="this.value=this.value.replace(/s+/g,'')"><inputtype="submit"value="查
询"></td>
</tr>
</table>
</form>