have you seen <cf_QueryToStruct> in the tag gallery? it takes a query, and a
Primary Key Column and returns a structure with he keys being the PK col.

If your query doesn't have PK column a struct of structs like this might do
the trick:
<cfset stEmployees=StructNew()>
<cfloop query="qEmployees">
        <cfscript>
                StructInsert(stEmployees["#qEmployees.CurrentRow#"], "Fname",
qEmployees.Fname);
                StructInsert(stEmployees["#qEmployees.CurrentRow#"], "Lname",
qEmployees.Lname);
                StructInsert(stEmployees["#qEmployees.CurrentRow#"], "Email",
qEmployees.Email);
        </cfscript>
</cfloop>
<!--- not tested, YMMV --->
-S
___________________________________________

  Sean Brown            <[EMAIL PROTECTED]>
  http://www.westcar.com/

  "Either way you get your dog back"
                          -Anonymous
___________________________________________


-----Original Message-----
From: Won Lee [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 09, 2000 1:02 PM
To: [EMAIL PROTECTED]
Subject: naming structures dynamically


anyone know how to name structures dyanmically with the currentrow
from a cfquery?

broken code under

<cfif get_email.recordcount GT 0>
<cfloop query="get_email">
        <cfscript>
        currRow = #get_email.recordcount#
        //MyStructure_currRow = StructNew();
        SetVariable(MyStructure_currRow, StructNew());
        StructInsert(MyStructure_currRow, "name",
"#get_email.FirstName# & #get_email.LastName#");
        StructInsert(MyStructure_currRow, "email",
"#get_email.Email#");
        </cfscript>
</cfloop>
</cfif>
----------------------------------------------------------------------------
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to