A simple example would be a db contruction where a JOIN is not possible (f.e. different databases).
query1 contains the ids of the customers, query2 will load the items corresponding to the customers (f.e. all items ordered by a certain customer). <cfoutput query="customers"> <cfquery name="selectitems"> select itemtitle from ordereditems WHERE customerid = #customers.id# </cfquery> <cfloop query="selecteditems"> #selectitems.itemtitle # (ordered by: #customers.name#) </cfloop> </cfoutput> I know this example isn't very good but the general question still exists if it is a bug that during a cfloop within a cfoutput always the first row is returned and not the currentrow record. Best regards, Peter ------------ Orginale Nachricht Von: <"Robertson-Ravo>,Neil (RX)" <[EMAIL PROTECTED]> Betreff: RE: cfoutput + cfloop: bug or Datum/Zeit: Dienstag, 11. Februar 2003 15:32:31 > I would not advise nesting them like this as you may get unexpected results > such as the first loop having more or less loop iterations than the > second... what are you trying to do? what are your goals... > > N > > -----Original Message----- > From: Peter Mayer [mailto:[EMAIL PROTECTED]] > Sent: 11 February 2003 14:26 > To: CF-Talk > Subject: cfoutput + cfloop: bug or > > > Hello! > > I have two queries - the output of the first one is handled by a cfoutput > > tag, the second one is handled by a cfloop (nested construction): > > <cfoutput query="query1"> > bla bla #query1.name#: > <cfloop query="query2> > #query2.surname# (event: #query1.eventtitle#)<br> > </cfloop> > > </cfoutput> > > > Now I have the result that query1.eventtitle always returns the first row > > of query1, it's not looping as desired. > > my workaround: > > <cfoutput query="query1"> > bla bla #query1.name#: > <cfset a_str_title = query1.eventtitle> > > <cfloop query="query2> > #query2.surname# (event: #a_str_title#)<br> > </cfloop> > > </cfoutput> > > This works as expected. > > We are on CF 5 (MX in the future time) > > Best regards, > > Peter > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

