• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Problem running a Cfloop in a Cfoutput

New Here ,
Apr 18, 2014 Apr 18, 2014

Copy link to clipboard

Copied

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

Views

223

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 19, 2014 Apr 19, 2014

Copy link to clipboard

Copied

LATEST

Good for you! Then mark your answer as 'correct'.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation