Mark Fuqua wrote:

>Worked like a charm.  Why [thisone][1]? What does the [1] do?  
>
The bracketed number or rather array notation is to denote the row in 
the query that you are looking at, so myquery["mycol"][1] will give you 
the value in mycol in myquery from the first row.

>It seems like it would be
>
><cfset session[thisOne] = areaJobInfo[thisOne]>
>  
>
That does work as it will usually pick up the values in the first row of 
the query, unless it is wrapped in a cfloop or cfoutput, in which case 
it will be the currentrow that it picks up.

In this instance it is probably a little more correct to specify the row 
you want to access.

>Also, how does cf know the variable name and value?
>  
>
With this struct notation you would normally use 
mystructname["mycolumnname"] - notice the quotes around the column 
name.  This notation takes a literal string for the field or column that 
will be used.  The above notation can also be used in the form 
mystructname.mycolumnname. 

When you don't enclose the string in quotes CF will use the supplied 
string as a variable from which to get the string it will use as the 
struct key. eg.

thisOne = 'mycolname';
session[thisOne] = myQuery[thisOne][1];

is that same as :

session["mycolname"] = myQuery["mycolname"][1];

and :

session.mycolname = myquery.mycolname[1];

Hope thats helps

Regards

Stephen


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:218671
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to