so what about getting column values dynamically out of queries?
I'm building xml code out of values in the db.
Due to annoying standard issues the column names are not the same as the
attribute names. So i'm storing them in an array as pairs. I then need to
get the values out of the database and build my xml string.
My function currently used evaluate but its very slow. And ugly. Any
ideas?
<!---
- generateAttributes
-
- Will generate the attribute string based on the given attribute array
and query resultSet.
-
- Arguments:
- attributes : The 2D array containing the attributes names and
the
column names.
-
- eg
- attributes[1][1] = column_name
- attributes[1][2] = axl atttribute_name
-
resultSet : The record containing the values.
- Returns:
- The attribute text.
-
--->
<cffunction name="generateAttributes" access="public"
returntype="string">
<cfargument name="attributes" type="array" required="yes">
<cfargument name="resultSet" type="query" required="yes">
<cfset text = "">
<cfoutput query="resultSet">
<cfloop index="index" from="1" to=
"#arraylen(attributes)#">
<cfset value_string =
evaluate(#attributes[index][1]#)>
<cfif value_string is not ''>
<cfset text = text &
#attributes[index][2]# & '="' & #value_string# & '" '>
</cfif>
</cfloop>
</cfoutput>
<cfreturn text>
</cffunction>
</cfcomponent>
---
You are currently subscribed to cfaussie as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/