On 26 January 2004 16:56, Christopher J. Crane wrote:
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
Christopher J. Crane wrote:
if($Balance = 10001) { echo font
color=\green\\$$Balance/fontbr\n; }
elseif($Balance = ) { echo font
color=\red\\$$Balance/fontbr\n; }
else { echo font color=\purple\\$$Balance/fontbr\n; }
Works fine here. The elseif condition will be true if $Balance is
you need one of the to if's to be either $Balance =1 elseif($Balance
1000) or $Balance 1 elseif($Balance = 1). Yours has the first
saying everything equal to or greater than 10001 which 1 is not else
everything less than or equal to which 1 is not. =)
Larry
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/fontbr\n; }
if($Balance = ) {
$Balance =
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
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,
Christopher J. Crane wrote:
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.
Well, duh! If you add periods and
Ok the problem seems to me, the format. I think that once I have the format
changed to include a comma seperation for thousands. I think at that point,
it is no longer a true number, so PHP deals with it differently.
Christopher J. Crane [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
8 matches
Mail list logo