Christopher J. Crane wrote:
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,'.',',');
    }

Display $Balance here. Just do a print $Balance. Something is wrong there, not below.


While we're at it, why are you looping through all of the rows setting $Balance each time? If it's only going to return one row, get that one row and use it!!

 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

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



Reply via email to