支持加号空格的查询
程序员文章站
2022-07-02 08:44:07
复制代码 代码如下:<% response.write "关键字:("&trim(request("q"))&")"&"
" x=repl...
" x=repl...
复制代码 代码如下:
<%
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>
上一篇: Python数据类型,可变数据类型与不可变数据类型
下一篇: 电压力锅怎么做蛋糕好吃