I realize that code I used in the past finds disfavor with many
and I’m trying to improve. However if it works… Here’s the code
to my current work. My problem is that only one line generates value
from my database (I’ve confirmed the database field). I’ve commented
the line that works. If I substitute that line in another it works but
editing the relocated line doesn’t work. Also the date doesn’t work.
I get no error messages. I’ll appreciate any constructive criticism:
<html><body background="oldorchard.jpg"><center>
<?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,$city,bstate,bzip,
sname,sstreet,scity,sstate,szip,
terms,duedate FROM oocust WHERE payrec = 'R' && pd = ''";
$result=mysql_query($query);
if(mysql_num_rows($result))
{
while(list( $acctno,$pd,$payrec,$orderno,
$bname,$bstreet,$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());
<!--the above code is for the date-->
?>
<form name='form'>
<input type=text size=25 value="Old Orchard Plumbing">
<input type=text size=25 value="2210 E. Hogan Hollow Road">
<input type=text size=25 value="Margate, Fl 33063"><p>
<!--?-->
<input type=text size=25 value="Date - <?php echo $mm/dd/yyyy;?>" />
<!--?-->
<!--the below line inserts the database field-->
<input type=text size=25 value="Acct# - <?php echo $acctno;?>" /><br>
<!--the above line inserts the database field-->
<TABLE BORDER=0 CELLPADDING=10 CELLSPACING=10>
<TD>
<p><label for="bname"><b>
<input type=text size=25 value="Bill To"><br>
<input type=text size=25 value="Name<?php echo $bname;?>" /><br>
<input type=text size=25 value="Street - <?php echo $bstreet;?>" /><br>
<input type=text size=25 value="City - <?php echo $bcity;?>" /><br>
<input type=text size=25 value="State - <?php echo $bstate;?>" /><br>
<input type=text size=25 value="Zip - <?php echo $bzip;?>" />
</TD>
<td>
<p><label for="sname"><b>
<input type=text size= 25 value="Ship To"><br>
<input type=text size=25 value="Name - <?php echo $sname;?>" /><br>
<input type=text size=25 value="Street - <?php echo $sstreet;?>" /><br>
<input type=text size=25 value="City - <?php echo $scity;?>" /><br>
<input type=text size=25 value="State - <?php echo $sstate;?>" /><br>
<input type=text size=25 value="Zip - <?php echo $szip;?>" />
</TD>
<TR>
<TD>
<input type=text size=25 value="Terms - <?php echo $terms;?>" /><br>
<input type=text size=25 value="Due Date - <?php echo $duedate;?>" /><br>
<input type=text size=25 value="order# - <?php echo $orderno;?>" />
</td>
<TD>
<img src="dave pic.jpg" width=175 height=200>
</td>
</tr>
</table>
<?php
}
}
?>
</form></body></HTML>