Looping Statement: Attribute validation error for CFLOOP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jsungmin
    New Member
    • Jan 2013
    • 13

    Looping Statement: Attribute validation error for CFLOOP

    hye. I have a little problem about loopping statement.
    This is the code..
    Code:
    <cfloop query="getQuest">
       <cfset count=0>
          <cfquery name="chechking" datasource="#ds#">
    	select status_flag
    	from survey_question
    	where status_flag = 'N'
          </cfquery>
            count = count+1;
    </cfloop>
    then I create another looping which loop base on value count.
    Code:
    <cfloop index="i" from="1" to="count">
    		<tr>
                            <td class="cssSearch" style="padding-left:5px;" align="center"></td>
    		</tr>
    	</cfloop>
    Then I got error
    //Attribute validation error for CFLOOP.
    line 412

    412: <cfloop index="i" from="1" to="count">//

    should I set addROW to replace value from #count# ??
    Code:
      <cfset addROW = #count#>
    Last edited by Meetee; Jan 18 '13, 04:50 AM. Reason: Use code tags around code <code/>
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    You need to put pound/hash around the count variable:
    Code:
    <cfloop index="i" from="1" to="#count#">
    Line 8 in the first code block should be <cfset count = count+1>

    Comment

    Working...