How do I get my HTML table to be created and data to be entered in slotts AAAAA, BBBBBB etc. I cannot seem to get any table output moving it within the PHP loop.
<?
session_start();
mysql_connect("localhost", "root") or die(mysql_error());
mysql_select_db("pagefeeds") or die(mysql_error());
$query="SELECT * FROM betasp";
$result=mysql_query($query);
// this tells me how many rows in table
$num=mysql_numrows($result);
// echo $num;
mysql_close();
// loop through the records in database
$i=0;
while ($i < $num) {
$one=mysql_result($result,$i,"Code");
$two=mysql_result($result,$i,"Description");
echo "<b>$one $two</b><br><hr><br>";
$i++;
}
?>
<html>
<head>
<meta http-equiv="Content-Language" content="en-gb">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Code</title>
</head>
<body>
<form method="POST" action="" >
<p> </p>
<table border="1" width="100%" id="table1">
<tr>
<td colspan="5"> </td>
</tr>
<tr>
<td width="18%" align="center"><font face="Arial"><b>Code</b></font></td>
<td width="34%" align="center"><font face="Arial"><b>Description</b></font></td>
<td width="5%" align="center"><font face="Arial"><b>Qty</b></font></td>
<td width="18%"><font face="Arial"><b>Unit Price £</b></font></td>
<td width="22%" rowspan="6"> </td>
</tr>
<tr>
<td width="18%">AAAAAAAA</td>
<td width="34%">BBBBBBBB</td>
<td width="5%" align="center"> </td>
<td width="18%">CCCCCCCC</td>
</tr>
</table>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
</form>
<p> </p>
<p> </p>
</body>
</html>
I only need the table headings bit shown once.
Any help much appreciated. The form event posting info is ommited at the moment. Regards
<?
session_start();
mysql_connect("localhost", "root") or die(mysql_error());
mysql_select_db("pagefeeds") or die(mysql_error());
$query="SELECT * FROM betasp";
$result=mysql_query($query);
// this tells me how many rows in table
$num=mysql_numrows($result);
// echo $num;
mysql_close();
// loop through the records in database
$i=0;
while ($i < $num) {
$one=mysql_result($result,$i,"Code");
$two=mysql_result($result,$i,"Description");
echo "<b>$one $two</b><br><hr><br>";
$i++;
}
?>
<html>
<head>
<meta http-equiv="Content-Language" content="en-gb">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Code</title>
</head>
<body>
<form method="POST" action="" >
<p> </p>
<table border="1" width="100%" id="table1">
<tr>
<td colspan="5"> </td>
</tr>
<tr>
<td width="18%" align="center"><font face="Arial"><b>Code</b></font></td>
<td width="34%" align="center"><font face="Arial"><b>Description</b></font></td>
<td width="5%" align="center"><font face="Arial"><b>Qty</b></font></td>
<td width="18%"><font face="Arial"><b>Unit Price £</b></font></td>
<td width="22%" rowspan="6"> </td>
</tr>
<tr>
<td width="18%">AAAAAAAA</td>
<td width="34%">BBBBBBBB</td>
<td width="5%" align="center"> </td>
<td width="18%">CCCCCCCC</td>
</tr>
</table>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
</form>
<p> </p>
<p> </p>
</body>
</html>
I only need the table headings bit shown once.
Any help much appreciated. The form event posting info is ommited at the moment. Regards