Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: help with code

  1. #1
    New to the CF scene
    Join Date
    Apr 2014
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    help with code

    Hi, I could use some help with this code. The issue is that the only php value I get is the date. The screenshot
    is to show intent.
    Code:
    <html><head>
         <title>billing</title>
    </head> 
    <?php
    // error_reporting(E_ALL ^ E_NOTICE);
    error_reporting(0);
    mysql_connect('localhost','root',''); 
    mysql_select_db('homedb') or die("Unable to select database");
    $query="SELECT acctno,pd,payrec,orderno, 
            bname,bstreet,bcity,bstate,bzip, 
            sname,sstreet,scity,sstate,szip, 
    terms,duedate FROM FROM oocust WHERE payrec = 'R' && pd = 'N'";
    $result=mysql_query($query);
    if(mysql_num_rows($result) ) 
        {
     while(list($acctno,$pd,$payrec,$orderno,$bname,$bstreet,$bcity,$bcity,$bstate,$bzip,             
                $sname,$sstreet,$scity,$sstate,$szip,$terms,$duedate)= mysql_fetch_row($result))                   
                // the below code is for the date 
                $format = "D M d Y g:ia"; 
                $date = date($format, time());
                }
                  ?> 
                 
    <body background="oldorchard.jpg"><center><font size=+1>  
    <form name='form' action="" method="post"><p> 
    <input type="text" size = 30 STYLE="color: #000000; background-color: #D4FFD4;" size = name="Name" value="Old Orchard Plumbing"> 
    <input type="text" size = 30 STYLE="color: #000000; background-color: #D4FFD4;" name="Address1" value="2210 E. Hogan Hollow Road"> 
    <input type="text" size = 30 STYLE="color: #000000; background-color: #D4FFD4;" name="Address2" value="Margate, Fl  33063"><p>
    <input type="text" size = 15 STYLE="color: #000000; background-color: #AAFFAA;" name="Date" value="<?php echo date('m/d/y');?>">
    <input type="text" size = 25 STYLE="color: #000000; background-color: #AAFFAA;" name="acctno" value="Acct#<?php echo $acctno;?>" />
    <TABLE BORDER="0" CELLPADDING="10" CELLSPACING="3">
        <TD>
    <TABLE BORDER="30" CELLPADDING="10" CELLSPACING="3" BORDERCOLOR="#D4FFD4">
        <TD>
    <input type="text" size=25 STYLE="text-align: center" color: #000000; background-color: #D4FFD4;" value="Bill To:"><br>    
    <input type="text" size=25 STYLE="color: #000000; background-color: #AAFFAA;" value="<?php echo $bname;?>" /><br>
    <input type="text" size=25 STYLE="color: #000000; background-color: #AAFFAA;" value="<?php echo $bstreet;?>" /><br>
    <input type="text" size=25 STYLE="color: #000000; background-color: #AAFFAA;" value="<?php echo $bcity;?>" /><br>
    <input type="text" size=25 STYLE="color: #000000; background-color: #AAFFAA;" value="<?php echo $bstate;?>" /><br>
    <input type="text" size=25 STYLE="color: #000000; background-color: #AAFFAA;" value="<?php echo $bzip;?>" /><br></TD>
       <TD>  
    <input type="text" size=25 STYLE="text-align: center" color: #000000; background-color: #D4FFD4;" value="Ship To:"><br>    
    <input type="text" size=25 STYLE="color: #000000; background-color: #AAFFAA;" value="<?php echo $sname;?>" /><br>
    <input type="text" size=25 STYLE="color: #000000; background-color: #AAFFAA;" value="<?php echo $sstreet;?>" /><br>
    <input type="text" size=25 STYLE="color: #000000; background-color: #AAFFAA;" value="<?php echo $scity;?>" /><br>
    <input type="text" size=25 STYLE="color: #000000; background-color: #AAFFAA;" value="<?php echo $sstate;?>" /><br>
    <input type="text" size=25 STYLE="color: #000000; background-color: #AAFFAA;" value="<?php echo $szip;?>" /><br></TD><p>
        <TR>       
       <TD>
    <input type="text" size=25 STYLE="color: #000000; background-color: #AAFFAA;" value="Terms:<?php echo $terms;?>" /><br>
    <input type="text" size=25 STYLE="color: #000000; background-color: #AAFFAA;" value="Due Date:<?php echo $duedate;?>" /><br>
    <input type="text" size=25 STYLE="color: #000000; background-color: #AAFFAA;" value="Order No:<?php echo $orderno;?>" /><br>
    
      <TD align="center"><img src="dave pic.jpg" width=150 height=150></td>
      </tr></table>
    </b></center></font></BODY></HTML>
    Attached Thumbnails Attached Thumbnails help with code-billing.jpg  

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,495
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    Give the script below a shot .... make sure you make a safe copy of your existing script before you overwrite it.

    Code:
    <html><head>
         <title>billing</title>
    </head> 
    <?php
    // error_reporting(E_ALL ^ E_NOTICE);
    error_reporting(0);
    mysql_connect('localhost','root',''); 
    mysql_select_db('homedb') or die("Unable to select database");
    $query="SELECT acctno,pd,payrec,orderno, 
            bname,bstreet,bcity,bstate,bzip, 
            sname,sstreet,scity,sstate,szip, 
    terms,duedate FROM FROM oocust WHERE payrec = 'R' && pd = 'N'";
    $result=mysql_query($query) or die(mysql_error());
    if(mysql_num_rows($result)) {
    $row = mysql_fetch_array($result) or die(mysql_error());
    }
    ?> 
    			  
    <body background="oldorchard.jpg"><center><font size=+1>  
    <form name='form' action="" method="post"><p> 
    <input type="text" size = 30 STYLE="color: #000000; background-color: #D4FFD4;" size = name="Name" value="Old Orchard Plumbing"> 
    <input type="text" size = 30 STYLE="color: #000000; background-color: #D4FFD4;" name="Address1" value="2210 E. Hogan Hollow Road"> 
    <input type="text" size = 30 STYLE="color: #000000; background-color: #D4FFD4;" name="Address2" value="Margate, Fl  33063"><p>
    <input type="text" size = 15 STYLE="color: #000000; background-color: #AAFFAA;" name="Date" value="<?php echo date('m/d/y');?>">
    <input type="text" size = 25 STYLE="color: #000000; background-color: #AAFFAA;" name="acctno" value="Acct#<?php echo $row['acctno'];?>" />
    <TABLE BORDER="0" CELLPADDING="10" CELLSPACING="3">
        <TD>
    <TABLE BORDER="30" CELLPADDING="10" CELLSPACING="3" BORDERCOLOR="#D4FFD4">
        <TD>
    <input type="text" size=25 STYLE="text-align: center" color: #000000; background-color: #D4FFD4;" value="Bill To:"><br>    
    <input type="text" size=25 STYLE="color: #000000; background-color: #AAFFAA;" value="<?php echo $row['bname'];?>" /><br>
    <input type="text" size=25 STYLE="color: #000000; background-color: #AAFFAA;" value="<?php echo $row['bstreet'];?>" /><br>
    <input type="text" size=25 STYLE="color: #000000; background-color: #AAFFAA;" value="<?php echo $row['bcity'];?>" /><br>
    <input type="text" size=25 STYLE="color: #000000; background-color: #AAFFAA;" value="<?php echo $row['bstate'];?>" /><br>
    <input type="text" size=25 STYLE="color: #000000; background-color: #AAFFAA;" value="<?php echo $row['bzip'];?>" /><br></TD>
       <TD>  
    <input type="text" size=25 STYLE="text-align: center" color: #000000; background-color: #D4FFD4;" value="Ship To:"><br>    
    <input type="text" size=25 STYLE="color: #000000; background-color: #AAFFAA;" value="<?php echo $row['sname'];?>" /><br>
    <input type="text" size=25 STYLE="color: #000000; background-color: #AAFFAA;" value="<?php echo $row['sstreet'];?>" /><br>
    <input type="text" size=25 STYLE="color: #000000; background-color: #AAFFAA;" value="<?php echo $row['scity'];?>" /><br>
    <input type="text" size=25 STYLE="color: #000000; background-color: #AAFFAA;" value="<?php echo $row['sstate'];?>" /><br>
    <input type="text" size=25 STYLE="color: #000000; background-color: #AAFFAA;" value="<?php echo $row['szip'];?>" /><br></TD><p>
        <TR>       
       <TD>
    <input type="text" size=25 STYLE="color: #000000; background-color: #AAFFAA;" value="Terms:<?php echo $row['terms'];?>" /><br>
    <input type="text" size=25 STYLE="color: #000000; background-color: #AAFFAA;" value="Due Date:<?php echo $row['duedate'];?>" /><br>
    <input type="text" size=25 STYLE="color: #000000; background-color: #AAFFAA;" value="Order No:<?php echo $row['orderno'];?>" /><br>
    
      <TD align="center"><img src="dave pic.jpg" width=150 height=150></td>
      </tr></table>
    </b></center></font></BODY></HTML>



    .


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •