Try referring to it as get_results.#qn#
Steven Semrau
SRA International, Inc.
Senior Member, Professional Staff
[EMAIL PROTECTED]
[EMAIL PROTECTED]
Com: (703) 805-1095
DSN: (703) 655-1095
-----Original Message-----
From: Jenny Anderson [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 03, 2001 2:42 PM
To: CF-Talk
Subject: Dynamic Variable Names
I want to dynamically create a variable name based upon a url variable.
First I set up a couple of strings:
<CFSET qs = 'q'>
<CFSET qn = #Insert(url.q, qs, 1)#>
Where q is a number from 1-37 passed via url variable. Let's say that
url.q is 7. Then qn is 'q7'.
So I query the database like this:
<CFQUERY NAME="get_results" DATASOURCE="datasource">
SELECT #qn#
FROM database
</CFQUERY>
And it correctly pulls all the results from the 'q7' column. So far so
good.
But now I want to be able to manipulate the query results and refer to the
q7's from the database query. If I refer to #qn# I only get q7 as the
result. So how do I have it refer to the variable q7 and not the string q7?
Thanks!
Jenny
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists