Re: Nested IFs Problem

From: Date: Wed, 31 Aug 2005 20:23:53 +0000
Subject: Re: Nested IFs Problem
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-221665@lists.php.net to get a copy of this message
why not rewrite it to be more concise... i can't see a problem at the moment. are you sure you can do a "<" comparison operator on the '12:00' and '2005-10-02' string?? Maybe if you are using 24 hr format you could just get rid of the ":" on both sides of the operator to have the "<" properly evaluated... do the same for the date comparison. just try each if statement individually. then, when you find the problem, rewrite like this: if ((putFirstExpressionHere) && (putSecondExpressionHere) && (putThirdExpressionHere)) {
    // success
} else {
    // failure
} Jordan On Aug 31, 2005, at 3:05 PM, Albert Padley wrote:
if ($row['date'] < '2005-10-02') {
            if ($row['time'] < '12:00') {
                if ($row['field'] == 'P5' ) {
                    echo "<td class=\"tabletextbluebg\">Success";
} } } else {
        echo "<td class=\"tabletextred\">Failed";
}


« previous php.general (#221665) next »