Quantcast
Channel: Adobe Community : Unanswered Discussions - ColdFusion
Viewing all articles
Browse latest Browse all 5794

Problem running a Cfloop in a Cfoutput

$
0
0

So I am trying to set up a table to have a set of rows repeated based on a variable set up in a separate location.  So I have table output being generated from a cfoutput of the query, then in the cfoutput tag, I have a cfloop statement with the <td>s for the columns that I need repeated based on my variable.  The problem I am experiencing is that the loop, instead of running from 1 to x (even when I hard coded the to = "2") is running per row the number of records in the cfoutput query in a decremental fashion, if my query has 11 rows, I get 11 loops the first run, then 10, then nine and so on. Has anyone experienced this before?  Here is the code, working with CF 9 on SQL Server 2012:

 

<cfoutput query="getNCDs">

     <tr>

          <td class="ins_grid_data">#getNCDs.ncdId#</td>

          <cfloop from="1" to="2" index="y" >

          <cfoutput>

 

......... and that is what is helpful about retyping things into a forum, sometimes you spot your own mistakes.  I don't need another <cfoutput> tag...I am IN a <cfoutput>. Took the extra tag out and the process worked the way I wanted it to.  Everybody have a good day.

 

Juss


Viewing all articles
Browse latest Browse all 5794

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>