Re: Nested IFs Problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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";
}


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux