Re: Newbie MySQL/PHP question re output formatting

2005-09-13 Thread Jasper Bryant-Greene
Nuno Pereira wrote: To do date change the first line from printf(" number_format({$thearray[cost]}, 2) to printf(" ".number_format({$thearray[cost]}, 2)." I think you mean: print( "" . number_format( $thearray['cost'], 2 ) . "" ); As stated by a previous poster to this thread, you should

Re: Newbie MySQL/PHP question re output formatting

2005-09-13 Thread Nuno Pereira
Bill Whitacre wrote: I can get this to work just fine: Comes out $23,999.39 I'd like use the number_format() thingie on an array returned from a mysql_query. My current program snippet looks like: $res = mysql_query("SELECT org, COUNT(*), SUM(annual_cost) AS cost FROM a05

Re: Newbie MySQL/PHP question re output formatting

2005-09-13 Thread Jigal van Hemert
Bill Whitacre wrote: printf(" {$thearray[org]} {$thearray["COUNT(*)"]} $ {$thearray[cost]} "); If I replace {$thearray[cost]} with number_format({$thearray[cost]}, 2) Although this is a MySQL mailing list and your problem is not MySQL related, but a PHP question I'

Newbie MySQL/PHP question re output formatting

2005-09-13 Thread Bill Whitacre
I can get this to work just fine: Comes out $23,999.39 I'd like use the number_format() thingie on an array returned from a mysql_query. My current program snippet looks like: $res = mysql_query("SELECT org, COUNT(*), SUM(annual_cost) AS cost FROM a05 GROUP BY org ORDER BY