Link to home
Start Free TrialLog in
Avatar of Panos
PanosFlag for Germany

asked on

Coldfusion - query to list question

Hello experts .
I need help to output two columns in a list.
I have a code that is working and i'm getting the output i need but i was thinking if i can use another function to 'build' the output (f.e. array).
My code  :

<cfoutput query="data" group="#arguments.sorting#">
     <cfset ruleslist = ''/>
      <cfoutput>
       <cfset listitem = 'testname_' & testname_id &  '=' &  testname_value/>
       <cfset ruleslist = listappend(ruleslist,listitem,'&')/>
      </cfoutput>
        #ruleslist#</br>
</cfoutput

Any help?
ASKER CERTIFIED SOLUTION
Avatar of _agx_
_agx_
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Panos

ASKER

Thank you very much for your help agx.
I'm sometimes wondering if there would be a better way of doing something.
Yes, it's good to check the options when working on a section of code.  In this case, that code is probably as good as it gets. As using db functions, does not really buy anything.

Glad I could help.