1.

Solve : trouble with date?

Answer»

Hi guys, would someone look over this and advise me what to do?
Below is error message.  I ain't figured out the date YET.
Quote

Parse error: syntax error, unexpected 'm' (T_STRING)
in C:\xampp\htdocs\invoice\apdue.php on line 8
Code: [Select]<?php
error_reporting(0);
mysql_connect('localhost','root',' ');
mysql_select_db('oodb') or die("Unable to select database");
$query=" SELECT * FROM oocust WHERE  payrec = 'P' &AMP;& pd = ' '
$result=mysql_query($query);
$num=mysql_numrows($result);
echo date("m/d/Y")"<br />";
echo "<FONT size=+2><b> Accounts Payable Report<br /><br />";
echo "<table cellspacing=1 cellpadding=0 border=0>
<tr>
<th colspan=3></th>
<th>due</th>
<th>days</th>
<th></th>
<th></th>
<tr>
<th>ACCT#</th>
<th>customer</th>
<th>description</th>
<th>date</th>
<th>late</th>
<th align=right>charges</th>
<th align=right>paid</th>
<th align=right>due</th>
<tr>
<TH colspan=9>==============</TH>
</tr>";
while($row = mysql_fetch_array($result))
{
$totcharges = $totcharges + $row['charges'];
$totdue = $totdue + $row['amtdue'];
$totpaid = $totpaid + $row['paidamt'];
echo "<tr>";
echo "<td>" . $row['acctno'] . "</td>";
echo "<td>" . $row['bname'] . "</td>";
echo "<td>" . $row['descr'] . "</td>";
echo "<td>" . $row['duedate'] . "</td>";
echo "<td align=right>" . $row['dayslate'] . "</td>";
echo "<td align=right>" . $row['charges'] . "</td>";
echo "<td align=right>" . $row['paidamt'] . "</td>";
echo "<td align=right>" . $row['amtdue'] . "</td>";
}
echo "<tr>";
echo "<th colspan=9>========/TH>";
echo "<tr>";
echo "<td>Gtotals</td>";
echo "<td colspan=4></td>";

echo "<td align=right>" . sprintf("%.2F",$totcharges) .
"</td>";
echo "<td align=right>" . sprintf("%.2f",$totpaid) .
"</td>";
echo "<td align=right>" . sprintf("%.2f",$totdue) .
"</td>";
echo "</tr>";
echo "</table>";
mysql_close();
?>


Discussion

No Comment Found