搜索功能 [英] Search function

查看:56
本文介绍了搜索功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以让我指出正确的方向......


我正在尝试为页面编写搜索功能以返回mp3列表中的结果文件名,我可以搜索一个单词没问题,但我想搜索多个单词并拉出具有所有owrds等单词的anthing。


我知道你用过能够用Dreamweaver做到这一点,但我似乎不能用cs3 ????

解决方案

你好,


您可以使用split()函数拆分单词并将每个单词循环到WHERE子句中。


例如:

展开 | 选择 | Wrap | 行号


这样返回的结果只有单词some或单词some等等。


我如何使用sql inmy通常的代码我通常按​​如下方式对我的数据库连接进行编码

展开 | 选择 | Wrap | 行号


@colinod


我不能从您上面发布的代码中获取,只是与您之前发布的内容无关。特别是你在前一篇文章中搜索歌曲文件名,上面的例子将会覆盖,但是在你的第二篇文章中,你隐含地将演员ID传递过来。


我错过了什么?


无论如何,这只是一个例子,我只是说明了一个可能的方向,即使用split()函数。


所以这会返回只有单词some或单词some等的结果。

http://www.w3schools.com/SQL/sql_like.asp


达伽兹


can ayone point me in the right direction for this......

I am trying to write a search function for a page to return results from a list of mp3 filenames, i can search for one word no problem but i want to search for multiple words and pull out anthing that has either of the words all of the owrds etc.

I know you used to be able to do this with dreamweaver but i can t seem to do it with cs3????

解决方案

Hi,

You can use the split() function to break apart the words and loop each word into your WHERE clause.

For example:

Expand|Select|Wrap|Line Numbers


so would this return results that had just the word some or the words some and for etc.

also how do i use the sql inmy usual code i usually code my database connections as follows

Expand|Select|Wrap|Line Numbers


@colinod
I can''t either from the code you posted above, just doesn''t seem to relate to what you posted previously. In particular you refer to searching in song filenames in your previous post, which the example above would cover, however in your second post you are implicitly passing the actor id over.

Am I missing something?

At any rate, it was only an example and I was just illustrating one possible direction, namely using the split() function.

so would this return results that had just the word some or the words some and for etc.

http://www.w3schools.com/SQL/sql_like.asp

Gaz


这篇关于搜索功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆