Need help in displaying result as a table.........
Posted: Wed Dec 02, 2009 9:50 pm
Hi I am just wondering if anybody can help me with this matter...... I have write a program that will display result contained in the database..... the program is successful but I don't like the way it display the result...... Therefore I am wondering is there anyway that I can do so that my result will be displayed as a table....... something that looks like a table with columns.....
This is what I have done so far.....
<?
$conn = odbc_connect("denggi", "" , "" );
if (!$conn)
{exit("Connection Failed: ".$conn);}
$query="SELECT * FROM msjp_sample";
$result=odbc_exec($conn,$query);
if(!$result)
{exit("Error in SQL");}
echo '<h3>MS Access Powered Database</h3>';
while(odbc_fetch_row($result))
{
$e_name=odbc_result($result,"NAMA");
$bulan=odbc_result($result,"BULAN");
$e_date=odbc_result($result,"ONSET");
echo '<b>Nama:</b>'.$e_name.'<br>';
echo '<b>Bulan</b>'.$bulan.'<br /> <b>Date:</b>'.$e_date.'<br />
<hr/>';
}
odbc_fetch_row($result);
odbc_close($conn);
?>
This is what I have done so far.....
<?
$conn = odbc_connect("denggi", "" , "" );
if (!$conn)
{exit("Connection Failed: ".$conn);}
$query="SELECT * FROM msjp_sample";
$result=odbc_exec($conn,$query);
if(!$result)
{exit("Error in SQL");}
echo '<h3>MS Access Powered Database</h3>';
while(odbc_fetch_row($result))
{
$e_name=odbc_result($result,"NAMA");
$bulan=odbc_result($result,"BULAN");
$e_date=odbc_result($result,"ONSET");
echo '<b>Nama:</b>'.$e_name.'<br>';
echo '<b>Bulan</b>'.$bulan.'<br /> <b>Date:</b>'.$e_date.'<br />
<hr/>';
}
odbc_fetch_row($result);
odbc_close($conn);
?>