不好意思,我没有调好,加到一下地方不行,谢谢!
<%
key1=split(key," ")
strsql="select * from camera where camera_name like '%"&keyword&"%' or camera_model like '%"&keyword&"%' or camera_int like '%"&keyword&"%'"
for i=0 to ubound(key1)
strsql=strsql&" or title like '%"&key1(i)&"%'"
next
set rs = Server.CreateObject("ADODB.Recordset")
rs.Open strsql, conn, 1, 1
total=0
total=rs.recordcount
while not rs.eof %>
[此贴子已经被作者于2006-1-6 13:58:10编辑过]
非常感谢您的热心帮助,我已改成
<%
key1=split(key," ")
strsql="select * from camera where camera_name like '%"&keyword&"%' or camera_model like '%"&keyword&"%' or camera_int like '%"&keyword&"%'"
for i=0 to ubound(key1)
strsql=strsql&" or camera_name like '%"&key1(i)&"%'' or camera_model like '%"&key1(i)&"%' or camera_int like '%"&key1(i)&"%'"
next
set rs = Server.CreateObject("ADODB.Recordset")
rs.Open strsql, conn, 1, 1
total=0
total=rs.recordcount
while not rs.eof %>
现在同样结果,只要结尾或文字间没有空格,就可以搜到,能在帮忙看看吗,谢谢。
非常感谢您的热心帮助,我已改成
<%
key1=split(key," ")
strsql="select * from camera where camera_name like '%"&keyword&"%' or camera_model like '%"&keyword&"%' or camera_int like '%"&keyword&"%'"
for i=0 to ubound(key1)
strsql=strsql&" or camera_name like '%"&key1(i)&"%'' or camera_model like '%"&key1(i)&"%' or camera_int like '%"&key1(i)&"%'"
next
set rs = Server.CreateObject("ADODB.Recordset")
rs.Open strsql, conn, 1, 1
total=0
total=rs.recordcount
while not rs.eof %>
现在同样结果,只要结尾或文字间没有空格,就可以搜到,能在帮忙看看吗,谢谢。
红色部份不对吧?
版主写的很明白了。
[此贴子已经被作者于2006-1-7 13:16:12编辑过]