<?php include("../../include/dbconnect.php");?>

<body background="i.jpg">

<center>
<h2><b>View Companies</h2></b>


<?php

$result=mysql_query("select distinct record,compcode,bankcode,accno from  bankacc where brcode ='$brcode' order by compcode") or
die(mysql_error());

$number_cols=mysql_num_fields($result);
echo "<table border=1> \n";
echo "<tr align=center> \n";
for($i=0;$i<$number_cols;$i++)
{
echo "<th>" . mysql_field_name($result,$i).   "</th>\n";
}
echo "<tr>\n";

//layout table

while($row = mysql_fetch_row($result))
{
echo "<tr align=left> \n";
echo "<td>";
if(!isset($row[0])) //test for null value
{
echo "NULL";
}
else
{
?>
<a href = "editview.php?record=<?echo($row[0]);?>"><?echo($row[0]);?></a>
<?

}

for($i=1;$i<$number_cols;$i++)
{
echo "<td>";
if(!isset($row[$i])) //test for null value
{
echo "NULL";
}
else
{
echo $row[$i];
}
echo "</td>\n";
}
echo "</tr> \n";
}
echo"</table>";

?>
<form><br><br><font size=1><center><a href= "index.html">Return to index page</center></font>
</body>
