|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[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!? PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 02:00:02 2025 UTC |
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) $i++; $i++; } 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 :-)Marking 2109 as dup, adding info here: Short Desc.: while kills while loop (part 2) [1999-08-10 04:10:06] commy_@hotmail.com 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.