Skip to main content
Inspiring
March 31, 2007
Question

Escaping #s ?

  • March 31, 2007
  • 1 reply
  • 236 views
I have a page with a list at the top of the DB items I want back in a query. I want to keep it in a list so that if i need to change what i want from the query I only have to change the list. But when looping through it I am having a problem in that what i want to do is output an item like this ##something##.

For Example

<cfset someList="abc, def, ghi">

<cfquery name="myQuery" datasource="source">
SELECT #someList# FROM table
</cfquery>

<cfoutput query="myQuery">
<cfloop index="index" list="someList">
<!---HERE IS MY PROBLEM--->
<td>##index##</td>
</cfloop>
</cfoutput>


I know I am overlooking some easy answer for this but I'm new to CF and it is just eluding me.

Any ideas would be appreciated. Thank you.
    This topic has been closed for replies.

    1 reply

    BKBK
    Community Expert
    Community Expert
    March 31, 2007
    <table>
    <cfoutput query="myQuery">
    <tr>
    <cfloop list="#someList#" index="index">
    <td>#Evaluate(index)#</td>
    </cfloop>
    </tr>
    </cfoutput>
    </table>