1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: EOF

Discussion in 'Software Development' started by kirkwebsites, Feb 24, 2014.

Thread Status:
Not open for further replies.
Advertisement
  1. kirkwebsites

    kirkwebsites Thread Starter

    Joined:
    Sep 10, 2011
    Messages:
    97
    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:
    <?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:
    <?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:
    </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
     
  2. kirkwebsites

    kirkwebsites Thread Starter

    Joined:
    Sep 10, 2011
    Messages:
    97
    Hi, I'm studying PDO and am past the error messages but now get a blank page. Please someone
    help with this ?

    PHP:
     <?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:
    </form></center></body></html> 
     
As Seen On
As Seen On...

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.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1120682