I'm having a problem setting the results of a query to a variable. What I'm trying to do is make an AJAX call to a .cfc file and pass back the results of the function. The main problem is, I'm trying to pass back a block of HTML code ( resulting from a cfquery to a cfoutput ) stored in a variable. My code is something like..
<cffunction name="getText" access="remote" returntype="void">
<cfquery datasource="#request.dsn#" name="queryTable">
SELECT infoA, infoB
<cfset result = '<!--- this is the part I'm stuck on, I want the table to go here. --->'>
<cfwddx action="cfml2js" input="#result#" toplevelvariable="r">
This is a simplified version of what I want to do, but you get the idea..
Is this even the right way of going about it?? Thanks
That is what I get for trying the e-mail reply feature! Aren't you glad I double checked my post.
You could do a bunch of string concatenation here doing stuff like <cfset result = result & "<td>" & infoA & "</td><td>" & infoB & "</td>"> over and over again. But really the <cfsaveContent...> tags is so much easier to use.
You are the best. I didn't even think of that. Thanks so much for the help!