Ok here is the wierd thing. I pasted more code, it seems to not work because of me changing the number format.
This works ... if($Balance >= 10001) { $Balance = number_format($Balance,2,'.',','); echo "<font color=\"green\">\$$Balance</font><br>\n"; } if($Balance <= 9999) { $Balance = number_format($Balance,2,'.',','); echo "<font color=\"red\">\$$Balance</font><br>\n"; } else { $Balance = number_format($Balance,2,'.',','); echo "<font color=\"purple\">\$$Balance</font><br>\n"; } This does not ... $SummaryResults = mysql_query("SELECT * FROM Accounting WHERE UserID='$UserID' LIMIT 1") or die("Invalid query"); while($SummaryField = mysql_fetch_array($SummaryResults)) { $Balance = number_format($SummaryField["Balance"],2,'.',','); } if($Balance >= 10001) { echo "<font color=\"green\">\$$Balance</font><br>\n"; } elseif($Balance <= 9999) { echo "<font color=\"red\">\$$Balance</font><br>\n"; } else { echo "<font color=\"purple\">\$$Balance</font><br>\n"; } "Stuart" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Christopher J. Crane wrote: > > if($Balance >= 10001) { echo "<font > > color=\"green\">\$$Balance</font><br>\n"; } > > elseif($Balance <= 9999) { echo "<font > > color=\"red\">\$$Balance</font><br>\n"; } > > else { echo "<font color=\"purple\">\$$Balance</font><br>\n"; } > > Works fine here. The elseif condition will be true if $Balance is > undefined. Are you sure that variable exists and is actually set to 10000? > > -- > Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php