RE: nested loops/queries

2001-08-16 Thread Philip Arnold - ASP
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

RE: nested loops/queries

2001-08-16 Thread Shawn Grover
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

RE: nested loops/queries

2001-08-16 Thread Tony Schreiber
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

RE: nested loops/queries

2001-08-15 Thread Brent Goldman
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

RE: nested loops/queries

2001-08-15 Thread xrussx
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

RE: nested loops/queries

2001-08-15 Thread Bryan Love
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