脚 本 之 家 www.jb51.net
页面导航: 首页网络编程ASP编程应用技巧 → 正文内容

支持加号空格的查询

发布:dxy 字体:[增加 减小] 类型:转载
复制代码 代码如下:

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

文章评论

共有 位脚本之家网友发表了评论我来说两句

最 近 更 新
热 点 排 行