I'm having a weird problem doing a nested loop and a nested query. I
have two queries. The topmenu query returns ids 1,2,3 and 4. The
leftmenu query returns ids 5,6,7,8,9 for topmenu.id=1 and 14,15,16 for
topmenu.id=3. The queries are right and return the right data. For
some reason
I've seen similar problems in my stuff.
My solution was as follows:
if I needed to refer to a query element from the outer loop, I would assign
it to a variable. Then whereever I needed it in the second loop, I would
refer to the variable.
A bit of a kludgy fix, but it worked, and I don't
I find that I have to use the second method (assigning outerloop id to a
variable) to get nested query loops to work right. I've never understood
why, but that has worked for me.
I am not 100% sure, but I think I know what is going on (Something similar
has happened to me before, too). In
Hi,
I am not 100% sure, but I think I know what is going on (Something similar
has happened to me before, too). In your third to last line, where you
output topmenu.id:leftmenu.id, the CFOUTPUT gets confused. Rather than
thinking that you are outputting each instance from the first CFLOOP, it
Thanks Brent, I did your second method and that worked :-)
Russ
-Original Message-
From: Brent Goldman [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 15, 2001 8:16 PM
To: CF-Talk
Subject: RE: nested loops/queries
Hi,
I am not 100% sure, but I think I know what is going
First of all it's suicide to put queries inside looping structures and CF
has accounted for that by allowing you to group query output.
Try this instead:
(SQL and ACCESS)
--
cfquery name=menu datasource=batu2
SELECT c.id AS catID, m.id AS
6 matches
Mail list logo