SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    Wanna-be Apple nut silver trophy M. Johansson's Avatar
    Join Date
    Sep 2000
    Location
    Halmstad, Sweden
    Posts
    7,400
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Is it possible to have a while loop within another while loop? Like this:

    while ($cheese = mysql_fetch_array($result) {

    while ($fruit = mysql_fetch_array($result2) {
    echo "blah blah";
    }

    }

  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes but just remember that the whole operation could take a long time with big nested loops. Mayeb there is a better way to do what you want can expound a bit.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  3. #3
    Wanna-be Apple nut silver trophy M. Johansson's Avatar
    Join Date
    Sep 2000
    Location
    Halmstad, Sweden
    Posts
    7,400
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Well, I know it's probably a crude way to do it - but there is probably no other way. I'll post the whole thing on the board for evaluation later, but right now, I'm WAY too tired. Gnight!

    Ps. My cat does not know PHP - the little bugger keeps saying that PERL is faster.
    Ds.

  4. #4
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ha!!! No way Perl is faster, your cat needs to do some homework
    Please don't PM me with questions.
    Use the forums, that is what they are here for.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •