I kinda like this one I made all you need to do is supply a query and it will output a nice formatted table for you
<?php
$result = dbquery('YOURQUERY');
$row = dbfetch($result);
$firstrow = true;
$num_of_rows = count($row);
$Header = array_keys($row);
$num_of_values = 0;
?>
<HTML>
<HEAD>
<style type="text/css">
#row0 {background-color: #DDEDC6}
#row1 {background-color: #FFFFFF}
</style>
</HEAD>
<BODY>
<?php
$index = 1;
echo "<table border=\"1\" width=\"100%\">\n";
do{
echo "<tr id=\"row";
echo $index%2;
$index += 1;
echo "\">\n";
if($firstrow){
for( $i = 1; $i < $num_of_rows; $i += 2){
echo "<td><b>";
echo $Header[$i];
echo "</b></td>\n";
}
echo "</tr>\n";
echo "<tr id=\"row";
echo $index%2;
$index += 1;
echo "\">\n";
$firstrow = false;
}
for ($i = 0; $i < $num_of_rows/2; $i += 1){
echo "<td>";
echo $row[$i];
echo "</td>\n";
}
echo "</tr>\n";
$num_of_values += 1;
}while($row = dbfetch($result));
echo "</table>\n";
echo "<hr>".$num_of_values." rows returned";
?>
</BODY>
</HTML>