Hi folks!
Q: How do I take the string value of a variable and make it a variable?
I.E., I have a variable called
variables.record
with the string value of
"getAll.mfg"
(also a query variable, created from a string and the url.vote variable)
How do I reference the value of variables.record to get access of the
query variable?
The "dead" code is below
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<CFQUERY NAME="getAll" DATASOURCE="survey">
SELECT *
FROM survey
</CFQUERY>
<cfparam name="url.vote" type="string" default="mfg">
<html>
<head>
<title>Show Results</title>
</head>
<body>
<cfif url.vote IS NOT "none">
<cfset variables.record = "getAll.#url.vote#">
<cfoutput>#variables.record#</cfoutput>
<cfset variables.count = #val(#(getAll.#url.vote#)#)#>
<cfoutput>#variables.count#</cfoutput>
<cfset variables.count = variables.count + 1>
<cfquery name="putVote" datasource="survey" dbtype="ODBC">UPDATE
survey
SET '#url.vote#'=#temp#
WHERE '#url.vote#'=#temp2#
</cfquery>
<p>Vote Registered!</p>
</cfif>
<CFQUERY NAME="getAgain" DATASOURCE="survey">
SELECT *
FROM survey
</CFQUERY>
<cfoutput>
<p>Manufacturer: #getAgain.mfg#<br>
Magazine Ad: #getAgain.mag#<br>
Email: #getAgain.email#<br>
Ebay: #getAgain.ebay#<br>
Friend: #getAgain.friend#<br>
Other: #getAgain.other#</p>
</cfoutput>
</body>
</html>
-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com
-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org