|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1972 while kills while loop
Submitted: 1999-08-05 11:06 UTC Modified: 2002-06-16 08:35 UTC
From: commy_ at hotmail dot com Assigned:
Status: Not a bug Package: Misbehaving function
PHP Version: 3.0.11 OS: Windows NT
Private report: No CVE-ID: None
 [1999-08-05 11:06 UTC] commy_ at hotmail dot com
Can't you have a While loop inside another While loop?
It seems that the second loop stops the first one!?


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [1999-08-05 14:24 UTC] slawrance at cvs dot php dot net
Are you using the same loop control variable in both loops
(assuming you're taking that approach)?

As an example, are you doing something like this:

$i = 0;
while ($i < 10) {
  $i = 0;
  while ($i < 20)

In that example, the second while loop would kill the one
on top due to the value of $i.  Try double-checking your
code, and if it still doesn't work then post the code that can reproduce misbehavior if possible :-)

 [1999-11-11 18:18 UTC] joey at cvs dot php dot net
Marking 2109 as dup, adding info here:

                      Short Desc.:
                                   while kills while loop (part 2)

                     [1999-08-10 04:10:06]

                               I think i found what the bug migh be. This is a seudo code that shows what im am doing.

                               while (odbc_fetch_row($first_result)) {
                                ... code ...
                                while (odbc_fetch_row($second_result)) {
                                 ... code ...

                               This example only returns one row (the last) from the $first_result. It seems that the two
                               while loops with a odbc_fetch_row() kills each other!?
                               I also tried with a "while" and "for" loop and it gave the same
                               result. So it must be the odbc_fetch_row() who screws up.
 [1999-11-14 03:45 UTC] joey at cvs dot php dot net
Can you verify if this bug still exists?
 [2002-06-16 08:35 UTC]
Thank you for taking the time to report a problem with PHP.
Unfortunately, PHP 3 is no longer supported. Please download
the latest version of PHP 4 from

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Aug 14 02:01:26 2020 UTC