asp利用Split函数进行多关键字检索
2018-09-06 12:40
阅读:588
            
  如题:我写入关键字到数据库,多的时候用隔开了,我提取再做相关文章搜索的时候,我怎么提取用隔开的文字啊,这样我就好用关键字做搜索啊 
回复: 
复制代码 代码如下: 
<script language=vbscript> 
dim keywords,operator,operend,strsql 
keywords=服装荷花名牌中国 
strsql = select * from table_name where 
operator= title LIKE % 
operend=% 
keywords=Join(Split(keywords,),operend & OR & operator) 
document.write strsql & operator & keywords & operend 
</script> 
该查询的用法: 
在添加数据记录时可写入多个关键字,关键字与关键字之间用隔开,当然也可以用其它字符,这样就需要修改一下相关的代码了。最后根据所产生的SQL语句即可查询出相关的记录
上一篇:控制表格的行列来显示数据
下一篇:ASP中字符串函数的应用
                    文章来自:搜素材网的编程语言模块,转载请注明文章出处。
文章标题:asp利用Split函数进行多关键字检索
文章链接:http://soscw.com/index.php/essay/10554.html
            文章标题:asp利用Split函数进行多关键字检索
文章链接:http://soscw.com/index.php/essay/10554.html
评论
亲,登录后才可以留言!