当前位置:编程学习 > asp >>

支持加号空格的查询

答案:

<%
Response.write "关键字:("&trim(request("Q"))&")"&"<hr>"
x=Replace(trim(request("Q"))," ",",")
'x=array(x)
t=split(x,",")
SQL="Select * From TB where kis<>0"
for i=0 to UBound(t)
if t(i)<>"" then
Response.write "第"&i+1&":"&t(i)&"<hr>"
SQL=SQL&" or title like '"&t(i)&"'" '这个是关键
end if
next
Response.write SQL
%>
<Form action="">
<table>
<tr>
<td><Input Name="Q" onkeyup="this.value=this.value.replace(/\s+/g,' ')"><input type="submit" value="查
询"></td>
</tr>
</table>
</form>

上一个:取得表单提交的所有数据
下一个:浏览文件夹下面所有图片

CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,