Good Question on the looking though all rows. I never wrote code looking at
just that one code and getting the variable from the column. That is why I
limited the query to one "LIMIT 1". I guess it is just me pasting code from
my other applications and not checking it out.

To the original problem, it all hinges on me changing the format of
$Balance. If I remove the line  " $Balance =
number_format($SummaryField["Balance"],2,'.',','); "
and replace it with " $Balance = $SummaryField["Balance"]; " it works fine.

"Stuart" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> 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