Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

Search Search
Search for:
Tech Support Guy > > >

Solved: EOF


(!)

kirkwebsites's Avatar
kirkwebsites kirkwebsites is offline
Computer Specs
Member with 94 posts.
THREAD STARTER
 
Join Date: Sep 2011
24-Feb-2014, 07:41 PM #1
Solved: EOF
Hi,I;ve gotten all tangled up here and could use some help. I'm sure I've seen reference to EOF. Below are my code and below the code are messages:

PHP Code:
<?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 Code:
<!DOCT.....<body>
PHP Code:
<?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($formattime()); 
            
// 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 Code:
</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
kirkwebsites's Avatar
kirkwebsites kirkwebsites is offline
Computer Specs
Member with 94 posts.
THREAD STARTER
 
Join Date: Sep 2011
26-Feb-2014, 04:29 PM #2
Hi, I'm studying PDO and am past the error messages but now get a blank page. Please someone
help with this ?

PHP Code:
 <?php 
include ('getnumbers.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($formattime()); 
            
// 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')";
   
        }  
     
    }catch (
PDOException $e){ 
        echo 
"Database error: ".$e->getMessage(); 
    } 

?>
HTML Code:
</form></center></body></html>
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
WELCOME TO TECH SUPPORT GUY!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.


(clock)
THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑