>Ok, can you explain this then:
>
>  Keyword[2][2]= DocArray[1][1]DocId =460
>                     DocArray[1][2]DocName = MyStory
>
>Are you saying that keyword[2][2]'s value is a 2d array? If so, what
>does DocId and DOcName imply? That isn't valid CFML. It looks like you
>are saying
>
>docarray[1][1] is a structure with a value of doc id.
>
>
>Also - can I say - this seems WAY overly complex. What if you perhaps
>stop and describe what type of data you are trying to represent.
>
>
>
>
>>I have a list of keywords.
I am looping over the list and running a query against my documents table and 
retirieving the documents(and the properties associated with each (author, 
pubdate, id, isbnnumber etc.) associated with each keyword. One keyword can 
have many documents associated with it. I want to be able to store and access 
this result set.

I want need to be able to output the keyword and all documents(and properties 
associated)later on in the page - I also want to be able to run qofq on the 
result set if prompted by the user, without having to loop and query again.

I thought of querying the table for all and grouping the result by Keyword, but 
I need the keywords in a specific order (that's why the list and initial loop).
Right now I am solving the problem by looping over the list and running the 
query , outputting the results then iterating the list and repeating.
here is a trimmed down version

<cfloop list="keywordlist" item="keyword">
 <cfoutput>#Keyword#</cfoutput>
  <cfquery name="docs" datasource="#application.dsn#>
    select doc_id, doc_name, doc_title, doc_author
    from documents
    where keyword = "#keyword#
  </cfquery>
<cfoutput query="docs">
   <li>#doc_id#, #doc_name# ....</li>
</cfoutput>
</cfloop>


There just has to be a better way - 
Thanks



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:5223
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-newbie/unsubscribe.cfm

Reply via email to