Hi all, im trying to out the contents of a mysql search to a web page, i can make the table without a problem, its just looks kinda messy as shown in mysql output.jpg that i have attached.
here is the code that im using:
$_Table = $_REQUEST["Cust"];
mysql_connect("localhost", "xxxxxx","xxxxxxxx") or die(mysql_error());
mysql_select_db("customers") or die(mysql_error());
$query="SELECT * FROM $_Table";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
$i=0;
echo "<BR>";
echo "<table width=95%, border=2>";
echo "<td width=9%>CustID</td><td width=8%>InvNo</td><td width=15%>Date</td><td width=10%>Qty</td><td width=20%>Product</td><td width=10%>Code</td><td width=10%>exVat</td><td width=10%>Vat</td></tr>";
echo "</table>";
while ($i < $num) {
$CustID=mysql_result($result,$i,"CustID");
$InvNo=mysql_result($result,$i,"InvNo");
$Date=mysql_result($result,$i,"Date");
$Qty=mysql_result($result,$i,"Qty");
$Product=mysql_result($result,$i,"Product");
$Code=mysql_result($result,$i,"Code");
$ExVat=mysql_result($result,$i,"ExVat");
$Vat=mysql_result($result,$i,"Vat");
echo "<table width=95%, border=2>";
echo "<td width=10%>$CustID</td><td width=13%>$InvNo</td><td width=20%>$Date</td><td width=8%>$Qty</td><td width=25%>$Product</td><td width=10%>$Code</td><td width=12%>$ExVat</td><td width=13%>$Vat</td></tr>";
echo "</table>";
$i++;
}
ive tried moving the code for creating the table but without success can anyone suggest how i can insert and entire column into a table instead of an individual row??
Thanks