Coldfusion 使用数据库中的邮件模板作为标记

Coldfusion 使用数据库中的邮件模板作为标记,coldfusion,Coldfusion,我使用数据库显示表中的结果,返回的数据是如下所示的数组格式: 使用以下coldfusion函数将查询结果返回到数组 <cffunction name="QueryToArray" access="public" returntype="array" output="false" hint="This turns a query into an array of structures."> <!--- Define arguments. ---> <cfarg

我使用数据库显示表中的结果,返回的数据是如下所示的数组格式:

使用以下coldfusion函数将查询结果返回到数组

<cffunction name="QueryToArray" access="public" returntype="array" output="false" hint="This turns a query into an array of structures.">
  <!--- Define arguments. --->
  <cfargument name="Data" type="query" required="yes" />
  <cfscript>    
    var LOCAL = StructNew(); // Define the local scope.
    LOCAL.Columns = data.getMetaData().getColumnLabels(); // Get the column names as an array.
    LOCAL.QueryArray = ArrayNew(1); // Create an array that will hold the query equivalent.
    for (LOCAL.RowIndex = 1 ; LOCAL.RowIndex LTE ARGUMENTS.Data.RecordCount; 
    LOCAL.RowIndex = (LOCAL.RowIndex + 1)){
        LOCAL.Row = StructNew();
        for (LOCAL.ColumnIndex = 1 ; LOCAL.ColumnIndex LTE ArrayLen(LOCAL.Columns); 
        LOCAL.ColumnIndex = (LOCAL.ColumnIndex + 1)){
            LOCAL.ColumnName = LOCAL.Columns[LOCAL.ColumnIndex];
            LOCAL.Row[LOCAL.ColumnName] = ARGUMENTS.Data[LOCAL.ColumnName][LOCAL.RowIndex];
        }
        ArrayAppend(LOCAL.QueryArray, LOCAL.Row);
    }
    return(LOCAL.QueryArray);
    </cfscript>
</cffunction>

因此,我想循环数组,将相关记录放在textarea中,然后一次更新所有记录,我应该怎么做,请指导,谢谢

如果您是新手,请先阅读。然后请更新您的问题,包括:a)您尝试了什么?b) 实际结果以及与您预期的结果的差异,以及c)任何错误消息。您面临的问题是什么?您将使用数组在一些文本区域中放置一些信息,那么为什么要将查询转换为数组呢?
id       name          description
1        ice           hello {name}, how are you!
2        fix           hello {name}, how are you!
3        cnt           hello {name}, how are you!
4        ice           hello {name}, how are you!
5        ice           hello {name}, how are you!