(Added
tags around the code -- NogDog)[/i]
I am having some difficulty positioning the created html table from a MySQL table. The problem seems trivial but I cannot figure it out.
The html table data is being created in a do ... while loop and what appears to be happening is that the table starts (the heading) after x blank lines where x is the number of rows in the MySQL table. I simply would like my html table to start at the top of the web page after my banner graphics.
The code is:
[code=php]
<html>
<body>
<img src ="citrus_banner4.jpg" name="citrus_banner" align=left width=1480 height=140 border=0>
<?php
echo '<form name="myform" method="post" action="receive-form.php">';
echo "<table border=1>";
echo "<tr><td><b>Customer</b></td><td><b>Telephone</b></td><td><b>Oranges</b></td><td><b>Grapefruits</b></td><td><b>Tangerines</b></td><td><b>Variety</b></td><td><b>\$Order</b></td><td><b>\$Paid</b></td><td><b>\$Owing</b></td><td><b>Picked Up</b></td><td><b>Comments</b></td>";
$db = mysql_connect("localhost", "root","password");
mysql_select_db("citrus_fundraiser",$db);
$result = mysql_query("SELECT * FROM customers",$db);
$result2 = mysql_query("SELECT * FROM prices",$db);
if ($myrow = mysql_fetch_array($result)) {
$myrow2 = mysql_fetch_array($result2);
do {
$cn = sprintf("%s %s",$myrow["firstname"],$myrow["lastname"]);
$ordered = ($myrow["citrus1"]*$myrow2["citrus1_price"])+($myrow["citrus2"]*$myrow2["citrus2_price"])+($myrow["citrus3"]*$myrow2["citrus3_price"])+($myrow["citrus4"]*$myrow2["citrus4_price"]);
$owing = $ordered - $myrow["paid"];
$total_order = $myrow["citrus1"] + $myrow["citrus2"] + $myrow["citrus3"] + $myrow["citrus4"];
?>
<tr bgcolor='red'><td><input type="text" name="cn_a[]" value="<?php echo $cn?>"></td>
<td><input type ="text" size ="12" name="phone_a[]" value="<?php echo $myrow["phone"]?>"></td>
<td><input type ="text" size ="6" name="citrus1_a[]" value="<?php echo $myrow["citrus1"]?>"></td>
<td><input type ="text" size ="11" name="citrus2_a[]" value="<?php echo $myrow["citrus2"]?>"></td>
<td><input type ="text" size ="10" name="citrus3_a[]" value="<?php echo $myrow["citrus3"]?>"></td>
<td><input type ="text" size ="10" name="citrus4_a[]" value="<?php echo $myrow["citrus4"]?>"></td>
<?php printf("<td>%01.2f</td>", $ordered); ?>
<td><input type ="text" size="5" name="paid_a[]" value="<?php echo $myrow["paid"]?>"></td>
<?php printf("<td>%01.2f</td>", $owing);?>
<td><input type ="text" size="9" name="pickedup_a[]" value="<?php echo $myrow["pickedup"]?>"></td>
<td><input type ="text" size="25" name="comments_a[]" value="<?php echo $myrow["comments"]?>"></td></tr><br>
<?php
} while ($myrow = mysql_fetch_array($result));
}
echo "</table>\n";
?>
<?php
<input type="submit" name="mysubmit" value="Submit">
</form>
}
?>
</body>
</html>