DO WHILE with OR not working?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Eric Rechter

    DO WHILE with OR not working?

    Hello I want to use the DO WHILE statement with an OR ( || )

    like this:

    do{
    ......
    }while ($found != 1 || $count == 10);


    But this is nog working in PHP 4.4 . Anybody know how to do this?

    Thanks!


  • Justin Koivisto

    #2
    Re: DO WHILE with OR not working?

    Eric Rechter wrote:[color=blue]
    > Hello I want to use the DO WHILE statement with an OR ( || )
    >
    > like this:
    >
    > do{
    > .....
    > }while ($found != 1 || $count == 10);
    >
    > But this is nog working in PHP 4.4 . Anybody know how to do this?[/color]

    What is the rest of the loop, and what are the values of $count and
    $found before it starts?

    Your while is saying to do the loop again only if $found is not 1 and
    $count *is* 10... possibly should be:

    while ($found != 1 || $count < 10);

    ?? without knowing what you want to do, it's impossible to say...

    --
    Justin Koivisto, ZCE - justin@koivi.co m

    Comment

    Working...