so basically u want to use the <cfoutput query inside the <cfloop,
i hope i understood u correctly :-)
i haven't checked this but just try and let e know
<!--- ==========================
<!-- Query of the products in our database --->
<CFQUERY name="products" datasource='nwchicagocdsco
SELECT Products.ProductName
FROM Products
GROUP BY Products.ProductName;
</CFQUERY>
<CFSET specialCharacters = " ()-">
<CFSET QueryEnd = products.recordcount>
<CFSET DrugName = "Vioxx">
<CFLOOP from="1" to="1040" index="i">
<CFOUTPUT query="products">
<CFSET NameLong = len(ListFirst(productname,
<CFHTTP url="http://mysite.com/pro
<CFSET PTR = findnocase("Dosage Forms", cfhttp.FileContent, 1)>
<CFSET END = len(cfhttp.FileContent)>
<CFSET EndOfLoop = FindnoCase('<table width="100%"', cfhttp.FileContent, ptr)>#i#<BR><!-- PTR = #PTR#, EOL = #EndOfLoop#<BR>-->
<CFLOOP condition="PTR LT EndOfLoop and ptr GT 0">
<CFSET hit = findnocase("#ListFirst(pro
<CFIF hit GT 0>
<CFSET EndURL = findnocase('</td>', cfhttp.FileContent, hit)>
<CFSET EndURL = (EndURL)>
<CFSET HowLong = (EndURL - hit)>
<CFSET Links = mid(cfhttp.FileContent, (hit), (HowLong))><!-- DEBUG INFO: Links: #endURL#, #HowLong#, -->#Links#,
<CFSET hit2 = findnocase('000">', cfhttp.FileContent, PTR)>
<CFSET EndCount = findnocase("</td>", cfhttp.FileContent, hit2)>
<CFSET HowLongCount = (EndCount - hit2)>
<CFSET Count = mid(cfhttp.FileContent, hit2 + 5, HowLongCount)>#Count#,
<CFSET Hit3 = findnocase("$", cfhttp.FileContent, PTR)>
<CFSET EndPrice = FindnoCase("</td>", cfhttp.FileContent, hit3)>
<CFSET HowLongPrice = (EndPrice - Hit3)>
<CFSET Price = mid(cfhttp.FileContent, hit3, howlongprice)>#Price#<BR>
<CFSET PTR = hit + 1>
<CFELSE>
DUMPED THE LOOP!<BR>
<CFSET PTR = 0>
</CFIF>
</CFLOOP>
<CFSET Hit4 = findNoCase('Drug Manufacturer:</b>', cfhttp.filecontent, EndOfLoop)>
<CFSET EndManufacturer = findnocase('<p><b>', cfhttp.FileContent, hit4)>
<CFSET HowLongMan = (EndManufacturer - Hit4)>
<CFSET Manufacturer = mid(cfhttp.FileContent, hit4, howlongman)>#Manufacturer#
<CFSET Hit5 = findNoCase('Common Uses:</b>', cfhttp.FileContent, EndOFLoop)>
<CFSET EndUses = FindNoCase('<p><b>', cfhttp.FileContent, Hit5)>
<CFSET HowLongUses = (EndUses - Hit5)>
<CFSET Uses = mid(cfhttp.FileContent, hit5, howlonguses)>#Uses#<BR>
<CFSET i = (i + 1)>
</CFOUTPUT>
</CFLOOP>
<!--- ==========================
Regards
Hart
Main Topics
Browse All Topics





by: WattsboPosted on 2003-09-02 at 17:34:16ID: 9271107
I loop through my queries all the time, using the <cfoutput query> tag like you have...
ID=#GetGam estats.Tea mAID#" target="main"><font color="000000">
ID=#GetGam estats.Tea mBID#" target="main"><font color="000000">
At first glance, it looks to me like every iteration of the loop generates a page based on the first item in the list...When the query runs, it creates the set of records...as you go through looping through the query, although it takes one item at a time, it never deletes the item from the list, so returning the first item from the full query will always give the same result.
Are you expecting to get as output 1040 different pages? I mean, I might be mis-reading your code, but on the surface to me it looks like you're gonna run through your loop 1040 times, and generate a page each time...and this loop is run for each record that the query returns...Although I may be totally misreading it!!
Just for an example, here's a (simple) query of mine that I loop through, might help? Might not too ;-)
<CFQUERY name="GetGamestats" datasource="ruggers">
SELECT TA.TeamName AS TeamA, TB.TeamName AS TeamB, Game.GameID, Game.WhenGame,
Game.TimeGame, Game.WinPick, Game.GameLocation, Game.TeamAScore, Game.TeamBScore,
Game.TeamATries, Game.TeamBTries, Game.TeamARed, Game.TeamBRed, Game.TeamAYellow,
Game.TeamBYellow, Game.TeamAID, Game.TeamBID
FROM Game INNER JOIN
Team TA ON Game.TeamAID = TA.TeamID INNER JOIN
Team TB ON Game.TeamBID = TB.TeamID
</CFQUERY>
<CFOUTPUT query="GetGamestats">
#TeamA# VS #TeamB# In #GameLocation#, #dateformat(WhenGame, 'dd/mm/yyyy')# at #timeformat(TimeGame, 'HH:mm')#<br><br>
<b><a href="./Teamstats.cfm?Team
#TeamA#</font></a> : #TeamAScore#</b><br>
#TeamATries# tries scored<br>
#TeamAYellow# yellow cards<br>
#TeamARed# red cards<br><br>
<b><a href="./Teamstats.cfm?Team
#TeamB#</font></a> : #TeamBScore#</b><br>
#TeamBTries# tries scored<br>
#TeamBYellow# yellow cards<br>
#TeamBRed# red cards<br><br>
</CFOUTPUT>
Basically, all it does is goes and gets a whole lot of games from a database, then for each game that it gets, it outputs the information associated with that game; So, if it retrieves 3 games, the info/output after the <cfoutput query...> tag is generated individually for each game, and the <cfoutput query> tag knows that it's gotta loop through until it runs outta records...
What is your actual desired output from your code? What is the end result you're trying to generate?