Hi,I;ve gotten all tangled up here and could use some help. I remember seeing newer code for this. Below are my code
and below the code are messages:
<?php
require "includes/getnumbers.php";
$host = "localhost";
//Database user name.
$login = "root";
//Database Password.
$dbpass = "";
//Database name.
$dbname = "homedb";
$PDO = new PDO("mysql:host=localhost;dbname=$dbname", "$login", "$dbpass");
?>
```html
<!DOCT.....<body>
<?php
if(isset($_GET['acctno']))
{
$acctno = trim($_GET['acctno']);
$R = "R";
try
{
$sql = "SELECT
acctno,pd,payrec,orderno,
bname,bstreet,bcity,bstate,bzip,
sname,sstreet,scity,sstate,szip,
terms,duedate
FROM oocust
WHERE acctno = :acctno AND payrec = :R AND pd = ''";
$query = $PDO->prepare($sql);
$query->bindParam(":acctno", $acctno);
$query->bindParam(":R", $R);
$query->execute();
while($row = $query->fetch(PDO::FETCH_ASSOC))
{
$acctno = $row['acctno'];
$pd = $row['pd'];
$payrec = $row['payrec'];
$orderno = $row['orderno'];
$bname = $row['bname'];
$bstreet = $row['bstreet'];
$bcity = $row['bcity'];
$bstate = $row['bstate'];
$bzip = $row['bzip'];
$sname = $row['sname'];
$sstreet = $row['sstreet'];
$scity = $row['scity'];
$sstate = $row['sstate'];
$szip = $row['szip'];
$terms = $row['terms'];
$duedate = $row['duedate'];
// the below code is for the date
$format = "D M d Y g:ia";
$date = date($format, time());
// the above code is for the date
$tax = $payable * $taxrate;
$amtdue = $payable + $tax + $shipamt;
$currdate = date('Y-m-d');
$date1 = $duedate;
$date2 = $currdate;
$diff = abs(strtotime($date2) - strtotime($date1));
$years = floor($diff / (365*60*60*24));
$months = floor(($diff - $years * 365*60*60*24) / (30*60*60*24));
$days = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24)/ (60*60*24));
// echo "Difference is $months months, $days days.";
$dayslate = $months *30;
$dayslate = $dayslate + $days;
$query = "
INSERT INTO oocust (acctno,status,pd,payrec,orderno,bname,bstreet,bcity,bstate,bzip,bemail,
phone,contact,sname,sstreet,scity,sstate,szip,semail,terms,fob,shipdate,shipamt,
dateord,datecomp,duedate,qty,descr,payable,tax,paidamt,datepaid,dayslate,checkno,
amtdue,prevbal,balance)
VALUES ('$acctno',$status','$pd','$payrec',$orderno','$bname','$bstreet','$bcity',
'$bstate','$bzip','$bemail','$phone','$contact','$sname','$sstreet','$sscity','$sstate',
'$szip','$semail','$terms','$fob','$shipdate','$shipamt','$dateord','$datecomp',
'$duedate','$qty','$descr','$payable','$tax','$paidamt','$datepaid','$dayslate',
'$checkno,'$amtdue','$prevbal,','$balance')";
}
}
}
?>
```html
</B></BODY></HTML>
" }
}
}
?> " gives
: Parse error: syntax error, unexpected ‘}’, expecting catch (T_CATCH) in
C:\xampp\htdocs\invoice\invoiceinsert.php on line 258
" }
}
?> " gives:
Parse error: syntax error, unexpected '?> ', expecting catch (T_CATCH) in
C:\xampp\htdocs\invoice\invoiceinsert.php on line 259