Top
Home

<?php
function MooseFind($tablename,$conn)
{
$query = "select * FROM $tablename" ;
$result= mysql_query($query, $conn) ;
$hostname = "HOST";
$username = "USERNAME";
$password = "PASSWORD";
$dbName = "DATABASE";
$conn = mysql_connect($hostname, $username, $password, $dbName);
$result=mysql_select_db($dbName,$conn);
$query="select * from $tablename";
$result= mysql_query($query, $conn);
$column_count=mysql_num_fields($result);
echo "<table border=\"1\" cellpadding=\"5\"> ";
$column_num=0;
while ($column_num < $column_count){
echo "<th>" . mysql_field_name($result, $column_num) . "</th>";
$column_num++;
}
$i = 0;
while ($row=mysql_fetch_row($result))
{
if ($i % 2 != 0) # An odd row
  $rowColor = "#fff";
else # An even row
  $rowColor = "#eee";
$column_count=mysql_num_fields($result);
echo "<tr align=\"left\" valign=\"top\" bgcolor=$rowColor>";
for (
$column_num=0;
$column_num < $column_count;
$column_num++
)
echo "<td>$row[$column_num]<br></td>";
$i++;
}
mysql_free_result($result);
echo "</table>";
}
?>
<style type="text/css">

table
{
  border-spacing:1px;
  border-style:solid;
  border-width:2px;
  border-color:#2C4F85;
  font:14px Georgia, serif;
  padding:0;
  box-shadow:0px 0px #000000;
  border-radius:5px;
}

th
{
  color:#FFFFFF;
  background:#2C7EDB;
  border-style:solid;
  border-width:1px;
  border-color:#2C4F85;
  font-weight:bold;
  padding:5px;
  text-align:center;
  vertical-align:top;
}

tr
{
  color:#5A7ECC;
  font-weight:normal;
}

tr:hover td
{
  color:#003;
}

td
{
  padding:3px 5px;
  text-align:left;
  vertical-align:top;
}

th:first-child
{
  border-top-left-radius:5px;
}

th:last-child
{
  border-top-right-radius:5px;
}

tr:last-child td:first-child
{
  border-bottom-left-radius:5px;
}

tr:last-child td:last-child
{
  border-bottom-right-radius:5px;
}

</style>


<?php MooseFind("TABLE01",$conn);?><br><br>
<?php MooseFind("TABLE02",$conn); ?>