Re: Seems Simple enough
| From: | Stuart | Date: | Mon, 26 Jan 2004 16:59:31 +0000 |
| Subject: | Re: Seems Simple enough | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-175784@lists.php.net to get a copy of this message | ||
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