can't get print table aligned

The below code works correctly except that the totals don’t align correctly on the page and the totcharges doesn’t display the decimals. Can someone tell me what I’m doing wrong?
[php]<?php
mysql_connect(localhost,root,"");
mysql_select_db(oodb) or die( “Unable to select database”);
$query=" SELECT * FROM oocust WHERE payrec = ‘R’ AND pd = ’ '";
$result=mysql_query($query);
$num=mysql_numrows($result);
echo date(“m/d/Y”) . “
”;
echo " Old Orchard Plumbing Invoices Due Report
";
echo "

"; while($row = mysql_fetch_array($result)) { // $charges=$row['charges']; // $tax=$row['tax']; // $amtdue=$row['amtdue']; $totcharges = $totcharges + $row['charges']; $tottax = $tottax + $row['tax']; $totamtdue = $totamtdue + $row['amtdue']; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } echo "
order
Inv# Customer date days late Charges tax Owed
=======================================================================
" . $row['invnum'] . "" . $row['bname'] . "" . $row['dateord'] . "" . $row['dayslate'] . "" . $row['charges'] . "" . $row['tax'] . "" . $row['amtdue'] . "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "";

echo “

”;
echo “”;
echo “”;
echo “”;
echo “
=======================================================================
Totals Due.... $totcharges$tottax$totamtdue
”;
mysql_close();
?> [/php]
Sponsor our Newsletter | Privacy Policy | Terms of Service