1. No Profile Picture
    Devshed Newbie (0 - 499 posts)

    I'm looping through a query, and inside
    the while result output, I am trying to loop through a second query (created from the 1st query's row results).

    I have checked that both queries return info.

    I can see that the 1st while result output works fine, but when I get to the inner while result output, it never returns any rows (nothing in the while loop evaluates).

    So, IS it possible to nest one query's
    output loop within another, or am I doing something wrong?

    I can post the example code, incase my description is confusing.

  2. #2
  3. No Profile Picture
    Devshed Newbie (0 - 499 posts)
    Yes, it can be done. But I had to instigate a second query, with a different result index variable to get the second loop to work correctly.

    As a guess, I don't think that two loops can run off of the same $result index at the same time, so a second one has to be created.... Again, that's only a guess as to the reason.

Similar Threads

  1. loop question
    By soupman99 in forum PHP Development
    Replies: 13
    Last Post: July 25th, 2003, 08:29 PM
  2. Problem with result sets and while loops
    By codechimp in forum Java Help
    Replies: 0
    Last Post: May 6th, 2003, 11:23 AM
  3. nesting loops to read files into mysql
    By Sketch in forum PHP Development
    Replies: 1
    Last Post: January 17th, 2003, 09:30 PM
  4. JS, form validation and '[' in form names
    By damon129 in forum HTML Programming
    Replies: 1
    Last Post: August 30th, 2001, 02:34 PM
  5. Nesting result loops within result loops possible?
    By powerrush in forum PHP Development
    Replies: 8
    Last Post: September 2nd, 1999, 07:24 PM

IMN logo majestic logo threadwatch logo seochat tools logo