CF Search/Array help

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default CF Search/Array help

    Hey all, quick question, any help will be terrific...

    Alright, so I have a verity search going...CF 6.1, it all works no
    problem...what I want to do is orginize the data into categories...so, it's
    searching under database fields of name, topic and category...i'd like to make
    my output look like

    Name:
    Result
    Result
    Result

    Topic:
    Result
    Result
    Result

    Category:
    Result
    Result
    Result

    And I haven't found an easy to way to do that...so what I did was split my
    index into 3 seperate indexes...specifically searching under name, topic and
    result...now, what i'm trying to do is pull the "key" using the cfsearch
    function to then query the database and get the rest of the data.

    So ultimately, I want to create a list that basically says...you searched for
    "Bill", and bill was found under name (some guy named bill) under category
    (some category named bill), etc...

    Now, I can output the data just fine, and see the keys, the problem is, I
    can't hold them...when I do a query like so...

    <cfoutput query="name">
    <cfset i = #key#>
    #key#
    </cfoutput>
    <cfquery datasource="numberonerule" name="everythingelse">
    Select ID, Name, Quote, Category, Topic
    From Quote
    where id = #i#
    </cfquery>

    and the key output is 10 11 12, the "everythingelse" query only runs for the
    last key result being "12".

    I assume the CFoutput "name" overwrites the variable everytime it runs
    through, and it runs first, before hitting the query resulting in me only
    getting 1 result not 3.

    Now, i've been playing with Array's figuring I could potentially throw an
    array into the cfoutput and hold all of the key results, but with little
    success...

    Any help would be awesome, i'm really suck, I hope I explained this
    well...thanks in advance

    CadenTerrik Guest

  2. Similar Questions and Discussions

    1. How to search into an array of objects?
      Hi, Is there a way to find an item into a array of object without parse each object? Ex: var : myArray : Array = new Array( {label : "cup",...
    2. ANN: InterAKT Site Search - search in multiple tables
      Hello, We have just released a new product, MX Site Search, meant to help web developers and designers create a search form in their dynamic...
    3. #25786 [NEW]: PHP website uses cookies to remember last search phrase in search box
      From: tipsen at imada dot sdu dot dk Operating system: - PHP version: Irrelevant PHP Bug Type: Unknown/Other Function Bug...
    4. search for duplicates and sort array
      Rick L wrote: Whenever someone wants to know if a <something> is a member of a set, then it springs to mind that a hash is desired, not an array....
    5. non recursive array on search
      I am getting the error message Notice: Uninitialized string offset: 7 in c:\inetpub\wwwroot\webpage10\example\search\dsp_search.php on line 61 ...
  3. #2

    Default Re: CF Search/Array help

    nevermind, got it working
    CadenTerrik Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139