Try this...
cfloop query=q
cfscript
ArrayAppend(vleafnodes, q.account_id);
/cfscript
/cfloop
However this is not going to give you the ability to reference the array
element by the account ID, it sounds like what you want is a structure.
cfloop query=q
cfscript
You'll need to use a struct to do your bidding instead of an array-- I don't
think you can skip values in arrays, so if your query is returning account_ids
1,2,4,5, #3 would fail.
maybe something like...
cfquery datasource=cfflex name=q
SELECT t1.account_id
FROM accounts1 AS t1
LEFT JOIN
Hi All -
I am trying to do the following in my code.
cfquery datasource=cfflex name=q
SELECT
t1.account_id
FROM
accounts1 AS t1
LEFT JOIN accounts1 as t2
ON t1.account_id = t2.parent_id WHERE t2.account_id IS NULL
/cfquery
cfset treeData
Well the obvious question is - are you sure variables.arrayLength exists? It
must not.
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
Dear Robert,
What does this code return to you?
cfif IsDefined(variables.arrayLength)
Variable exists
cfelse
Variable does not exist
/cfif
_
From: Robert Orlini [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 02, 2004 3:11 PM
To: CF-Talk
Subject: Array error
Why do I get this
I get:
1 Variable does not exist
Robert O.
-Original Message-
From: Micha Schopman [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 02, 2004 12:18 PM
To: CF-Talk
Subject: RE: Array error
Dear Robert,
What does this code return to you?
cfif IsDefined('variables.arrayLength
So, where do you set the var arrayLength? Probably never Set it and
your code will work.
-Original Message-
From: Robert Orlini [mailto:[EMAIL PROTECTED]
Sent: woensdag 2 juni 2004 19:31
To: CF-Talk
Subject: RE: Array error
I get:
1 Variable does not exist
Robert O
7 matches
Mail list logo