Results 1 to 10 of 10

Thread: search function

  1. #1
    Join Date
    Jan 2004
    Posts
    5

    Unanswered: search function

    I want to take text from a user and have it search for some or part of what they enter with colums in 2 or more tables?

    Can it be done? If yes can someone point me in the right direction?

  2. #2
    Join Date
    Dec 2003
    Posts
    454
    Specific post can be more helpful.

  3. #3
    Join Date
    Jan 2004
    Posts
    5

    More Specific On SQL search

    I think I need to take the text that someone put in a web form and then break it up so I can search for any one of those words in a SQL statment. I need help in how to get sql to go though that and put them all together in one query? Any idea?

    This is what I have now and I know it is not even close:

    SELECT distinct list_company, List_state, list_address_1, LIST_CITY, LIST_PHONE_1, LIST_EMAIL
    FROM master_list, category where master_list.list_company like '%#advfind#%' or master_list.List_state like '%#advfind#%' or master_list.List_address_1 like '%#advfind#%' order by List_Company

  4. #4
    Join Date
    Dec 2003
    Posts
    454
    What is your database? MSSQL or MS Access?

  5. #5
    Join Date
    Dec 2003
    Posts
    454
    In ASP code, you can use Split(expression, delimiter) to seperate the string which user types in. When you get the keywords (in array), you need a For loop and then add all keywords into WHERE clause.

  6. #6
    Join Date
    Jan 2004
    Posts
    5
    SQL Server 2000

  7. #7
    Join Date
    Jan 2004
    Posts
    5

    Coldfusion

    You know coldsufion?

  8. #8
    Join Date
    Dec 2003
    Posts
    454

    Re: Coldfusion

    Originally posted by HopeMod
    You know coldsufion?
    Why did you use "#" in your WHERE clause? Okay, I know why because of coldsufion. I know a little.
    Last edited by gyuan; 01-16-04 at 14:17.

  9. #9
    Join Date
    Jan 2004
    Posts
    5

    Re: Coldfusion

    Because the person askig for this search funtion is using Coldfusion

  10. #10
    Join Date
    Dec 2003
    Posts
    454
    After you get keywords from the string that use enters in the form, you can do a loop and then add the keywords in WHERE clause.

Posting Permissions

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