> From: Micha Schopman [mailto:[EMAIL PROTECTED] > <cfquery name="showArticle" datasource="user020"> SELECT A.*, > Au.authorID, Au.authorFirstName, A,authorSurname FROM > Articles A JOIN Authors Au ON (Au.AuthorID = A.AuthorID) > WHERE A. articleID = '#url.updateID# </cfquery> > Now you get authors * articles on records back. No problem with that. > <cfset stArticles = structNew()> > <cfloop query="showArticle"> > <!--- create first time structure for this specific article ---> > <cfif NOT structKeyExists(stArticles,"art_"&articleID)> > <cfset stArticles["art_"&articleID] = arrayNew(1)> > </cfif> > <!--- add this author to the structure for this article ---> > <cfset arrayAppend(stArticles["art_"&articleID],authorID)> > </cfloop> > something like that .. now you can output all data with > cfloop collection for example :) You make the calls.
As Pascal stated, there is NO need for an INNER JOIN or any type of join for that matter. Stuart wants to populate a list with authors and when an author is selected grab the articles for that author. IMO, the best solution would be to cache the results of a query that got a listing of the authors and another query to get the specific articles for the author. Why would you get all the data at once only to make CF parse through what is desired. Also, two queries keep the purpose of the queries confined whereby allowing better reuse in other areas... Should Stuart need to get a list of authors again, etc. Mike ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net http://www.cfhosting.net Message: http://www.houseoffusion.com/lists.cfm/link=i:4:183847 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

