Jump to content

Search box that searches multiple words


ahill

Recommended Posts

What database are you using? I'm not sure about "select top 10 * mproblem", that seems like it would be an error. For the filtering issue, you're not getting the search term correctly, pay attention to what you're doing.

Link to comment
Share on other sites

its pulling from my advancedtrouble table in my test database. I had the top 10 * in yesterday by mistake when I posted. It dose not make any noticeable impact though..For the term it should be referencing my database and changing on input of a character. only thing I am confused with is they haveterm = Replace( Trim(Request("word")), "'", "''" )SQL = "select top 10 * mproblem from DBtable where mproblem like '%" & term & "%'"---------------------------------------------------------------------------------------------shouldn't it be something more likeSQL= "select mproblem from DBtable where mproblem like '% %' or mproblem like '"+ term +"'"ORSQL = " select mproblem from DBtable where mproblem like '"% & term & %"'Both of these fail if used

Edited by ahill
Link to comment
Share on other sites

Wait now I was able to make it search. I changedterm = Replace( Trim(Request("word")), "'", "''" )TOterm = Replace( Trim(Request("q")), "'", "''" )Since javascript is passing the variable q from index.html to livesearch.asp.-----------------------------------------------------------------------------------My only problem is now is that I have to figure out how to get each result to display on its own line, right now they are all one line.ex.NOWresult1 result2 result3 result4What I wantresult 1result 2result 3result 4

Link to comment
Share on other sites

My only problem is now is that I have to figure out how to get each result to display on its own line, right now they are all one line.

You can send parameters to the RecordSet.getString method to tell it how to format the output, or you can loop through the recordset and format things yourself.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...