multiple word search

Results 1 to 2 of 2

Thread: multiple word search

  1. #1
    Join Date
    Dec 1969

    Default multiple word search

    i have a text box... what im trying to do is break down the words typed into that check box. i think i have to use an array for this... the only thing is that i have no clue how to do arrays. ive been reading on arrays but its all foriegn to me no matter how much i read.<BR><BR>well, example<BR>&#060;input type=text value="a b c d e" name=searchbox&#062;<BR><BR>strSearch = Request("searchbox")<BR><BR>sql = "select question, answer from "<BR>for each word in the text box (since there are 4) it would loop 4 times through this part of the sql script<BR> sql = sql & "question where (question like %&#039;" & strSearch & "%&#039; Or answer like %&#039;" & strSearch & "&#039;%) Or"<BR> &#039; have a script to catch the last line and remove the last "Or" in the end of the sql statement being generated<BR>Next<BR>sql = sql & ""ORDER BY fldAuto;"<BR><BR>so when you do a response.write sql it should print out like<BR>"select question, answer from question where <BR>(question like &#039;% a %&#039; Or answer like &#039;% a %&#039;) Or <BR>(question like &#039;% b %&#039; Or answer like &#039;% b %&#039;) Or <BR>(question like &#039;% c %&#039; Or answer like &#039;% c %&#039;) Or <BR>(question like &#039;% d %&#039; Or answer like &#039;% d %&#039;) Or<BR>(question like &#039;% e %&#039; Or answer like &#039;% e %&#039;)<BR><BR><BR>any help would be great<BR>Thanx<BR>Chuck

  2. #2
    brother love Guest

    Default RE: multiple word search

    if you know that your string will consist of characters or other strings separated by spaces, use Split() to get an array<BR><BR>more on Split():

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts