Ha, it's really a good idea, it works fine now.
Thanks Rich, you really saved my life:)

Bo

----- Original Message ----- 
From: "Rich Wild" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 04, 2003 9:01 AM
Subject: RE: [ cf-dev ] variables in CF


> ah right, you're getting unknown fields from an unknown table?
> 
> I wouldn't both converting columnlist to an array, just use the list.
> 
> <table>
> <cfloop from="1" to="#db.recordcount#" index="row">
> <tr>
> <cfloop list="#db.columnlist#" index="col">
> <td align=center>
> <cfoutput>#db[col][row]#</cfoutput>
> </td>
> </cfloop>
> </tr>
> </cfloop>
> </table>
> 
> > -----Original Message-----
> > From: Bo Jiang [mailto:[EMAIL PROTECTED] 
> > Sent: 03 December 2003 19:00
> > To: [EMAIL PROTECTED]
> > Subject: Re: [ cf-dev ] variables in CF
> > 
> > 
> > Thanks Rich,
> > 
> > The thing is I am trying to do a page can read different 
> > database by a Select/List Menu.
> > 
> > So, after I got the table name, I run a query to read data 
> > and fill query.columnlist to an array by ListToArray().
> > 
> > But, after that, I can't read the content of those data 
> > fields by quote this array.
> > 
> > My code is mainly like followed, it just display many times 
> > field name not the content.
> > 
> > Do you have any idea about that?
> > 
> > Cheers
> > 
> > Bo
> > 
> >  <cfif isdefined("url.did")>
> >   <cfquery datasource="opps" name='db'>
> >    Select * from #url.did#
> >   </cfquery>
> >   <cfif len(trim(db.columnlist)) gt 0>
> >    <cfset columns = ArrayNew(1)>
> >    <cfset columns = listtoarray(db.columnlist,",")>
> >   </cfif>
> > ........
> > <cfform>
> >   ....
> >   <cfoutput query="db">
> >   <tr>
> >    <cfloop index="count" from="1" to=#arraylen(columns)# step="1">
> >    <cfset dbfield="db." & columns[count]>
> >    <td 
> > align="center"><cfoutput><cfoutput>#dbfield#</cfoutput></cfoutput>
> >    </td>
> >    </cfloop>
> >   </tr>
> >   </cfoutput>
> > .......
> > </cfform>
> > 
> > ----- Original Message ----- 
> > From: "Rich Wild" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Wednesday, December 03, 2003 3:45 PM
> > Subject: RE: [ cf-dev ] variables in CF
> > 
> > 
> > > yup, although there you setting var2's value to a string containing 
> > > the alphanumeric data "var1", not the value of var1 itself.
> > > 
> > > instead, simply do this:
> > > <cfset var1 = "test">
> > > <cfset var2 = var1>
> > > 
> > > <cfoutput>#var2#</cfoutput>
> > > 
> > > > -----Original Message-----
> > > > From: Bo Jiang [mailto:[EMAIL PROTECTED]
> > > > Sent: 03 December 2003 14:50
> > > > To: [EMAIL PROTECTED]
> > > > Subject: [ cf-dev ] variables in CF
> > > > 
> > > > 
> > > > Hi,
> > > > 
> > > > I just wonder if I can use a variable to quote another
> > > > variable. For example:
> > > > 
> > > > <cfset var1="test">
> > > > <cfset var2="var1">
> > > > 
> > > > Is that possible to use var2 to get the value of var1?
> > > > 
> > > > Cheers
> > > > 
> > > > Bo
> > > > 
> > > 
> > > 
> > > --
> > > ** Archive: 
> > http://www.mail-archive.com/dev%> 40lists.cfdeveloper.co.uk/
> > > 
> > 
> > > To unsubscribe, e-mail: 
> > [EMAIL PROTECTED]
> > > For additional commands, e-mail: 
> > [EMAIL PROTECTED] For 
> > > human help, e-mail: [EMAIL PROTECTED]
> > > 
> > 
> 
> 
> -- 
> ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
> 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> For human help, e-mail: [EMAIL PROTECTED]
> 
> 

Reply via email to