RE: [PHP] Seems Simple enough

2004-01-27 Thread Ford, Mike [LSS]
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

Re: [PHP] Seems Simple enough

2004-01-26 Thread Stuart
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

RE: [PHP] Seems Simple enough

2004-01-26 Thread Larry Brown
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

Re: [PHP] Seems Simple enough

2004-01-26 Thread Christopher J. Crane
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 =

Re: [PHP] Seems Simple enough

2004-01-26 Thread Stuart
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

Re: [PHP] Seems Simple enough

2004-01-26 Thread Christopher J. Crane
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,

Re: [PHP] Seems Simple enough

2004-01-26 Thread Stuart
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

Re: [PHP] Seems Simple enough

2004-01-26 Thread Christopher J. Crane
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]