i have this cfcomponent, this one:
<cfcomponent displayname="participation_validator" hint="participation in n number of weeks per user"> <cffunction name="getWeekPerUser" hint="Gets all weeks where a user has played" returntype="numeric"> <cfargument name="usernid" type="string" required="yes"> <cfquery name="getWeekPerUserQuery" datasource="capperscorner" > select distinct count(week) as nweeks from tablex where account = '#usernid#' </cfquery> <cfreturn getWeekPerUserQuery.nweeks[1]> </cffunction> </cfcomponent>
it's simple, it just return a numeric, this componet is invoke by this code(the whole cfm file is too big, so this is a part):
<td align="center"> <cfinvoke component="participation_validator" method="getWeekPerUser" returnvariable="weekscount"> <cfinvokeargument name="usernid" value=#account#> </cfinvoke> <cfoutput>#weekscount#</cfoutput> </td>
so the problem was that the #weekscount# value into the <cfoutput> tag, printed many times (like in a loop), no idea why, so what I did was take out the #weekscount# value from the <cfoutput> tag, and as I expected, the value only printed once.
The question is; why when the value was into the tag, this one got printed many times? i thought at first "maybe theres a loop somewhere", but when I took the value outside the tag,everything works ok
thx in advance
This post has been edited by sattua: 28 July 2011 - 10:58 AM

New Topic/Question
Reply




MultiQuote






|