Should Help,
Edit Connection Details, Table, Column, Rows and test it!
<?php
// Database Connection Details
define("DB_SERVER","localhost");
define("DB_USER","dbusername");
define("DB_PASS","dbpassword");
// Open Database Connection
$db->connect_host(DB_SERVER, DB_USER, DB_PASS);
// Query the Relevent Table
$str_SQL = "SELECT * FROM tablename";
$result = $db->query_db("databasename",$str_SQL);
// Start to Build the Data Display Table
$pagetext.='<table align="center" cellspacing="1" cellpadding="3" bgcolor="#000000">
<tr>
<td colspan="2" bgcolor="#FFFFFF" align="center">Display Table</td>
</tr>
';
// If More than "0" Results for the Query
// Echo Out a Row for Each Result
if(mysql_num_rows($result)>0)
{
$mydata1=$rows['column1'];
$mydata2=$rows['column2'];
while($rows = mysql_fetch_array($result))
{
$pagetext.=' <tr>
<td bgcolor="#FFFFFF">'.$mydata1.'</td>
<td bgcolor="#FFFFFF">'.$mydata2.'</td>
</tr>
';
}
}
else
// If No Data in the Queried Columns
// Echo Out a Message within the Table
{
$pagetext.=' <tr>
<td colspan="2" bgcolor="#FFFFFF">No Data to Display</td>
</tr>
';
}
// Close the Table
$pagetext.='</table>
';
// Echo Out the Page
echo $pagetext;
?>