Ask a Question related to Macromedia ColdFusion, Design and Development.
-
Bukzor #1
Help with variable query?
I'm having an arbitrary query input by the user, then to make that query into
an excel file it must be put into a table similar to below. Since I don't know
the number of columns necessarily i use ListLen(), and since I don't
necessarily know the names of all the colums i use <cfloop>. I am able to put
all the names of the columns into an excel file in this way (by using "i"
instead of "OSFAres.i").
Basically all of this works except the part with "OSFAres.i". An error is
thrown "no member i exists of query OSFAres" even though "i" should hold the
name of one of the columns. Basically I need to find a way to force the server
to evaluate i before it evaluates OSFAres.i.
<table cols="#ListLen(OSFAres.ColumnList)#">
<cfoutput query="OSFAres">
<tr>
<cfloop LIST="#OSFAres.ColumnList#" index="i">
<td>#OSFAres.i#</td>
</cfloop>
</tr>
</cfoutput>
</table>
Bukzor Guest
-
PARSING A QUERY OF QUERY WITH A VARIABLE VALUE
On my first page the user selects a project. I am using the variable SelectedProject: <cfset SelectedProject =... -
Using a Variable to create the SQL Query
I need to create a "dynamic" Update query. I want to store the meet of the command in a variable and then reference the variable in in query. ... -
Passing a variable to a query
<cfset ctr=1> <cfloop list="#query1#" index = "i" delimiters = ","> <cfset thisColumn = "subcat_"&#ctr#> <cfquery name="insertNodes"... -
Using variable in sql query
Hello again, I'm trying to run an sql query using a string as in the following: <cfset string = "address1=' #evaluate("form.param#count#")# ',... -
Variable Syntax Query
I'm building a button bank of 6 buttons whereby pressing one button releases the last button activated. Each button is it's own movie clip named... -
gwgiswebmaster #2
Re: Help with variable query?
<cfloop LIST='#OSFAres.ColumnList#' index='i'>
<td>#i#</td>
</cfloop>
gwgiswebmaster Guest
-
Bukzor #3
Re: Help with variable query?
gwgiswebmaster:
That does does run without error, but it puts the titles of the columns in the table, not the data from the query.
Bukzor Guest
-
gwgiswebmaster #4
Re: Help with variable query?
sorry, misunderstood exactly what you were going for, try this: <cfoutput>
<table> <tr> <cfloop LIST='#OSFAres.ColumnList#' index='i'>
<td>#i#</td> </cfloop> </tr> <cfloop query='OSFAres'> <tr> <cfloop
LIST='#OSFAres.ColumnList#' index='i'> <td>#Evaluate('OSFAres.' &
i)#</td> </cfloop> </tr> </cfloop> </table> </cfoutput>
gwgiswebmaster Guest
-
Bukzor #5
Re: Help with variable query?
thankyou thankyou
exactly what i was looking for :)
Bukzor Guest



Reply With Quote

