<html>
<head>
<title>Print Database</title>
<style type="text/css">
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
</style>
</head>
<body>
<?php
include_once('connection.php');
$query = "SELECT products.products_id, products_description.products_name, products.products_price FROM products, products_description";
$result = mysql_query($query) or die (mysql_error());
//Print out Results
while($row = mysql_fetch_array($result)){
echo "<div style='width: 600px; background-color: #CCCCCC; margin-bottom: 10px; padding: 4px 4px 4px 4px;'>";
echo "<div style='font-size: 12px; font-family: Arial, Helvetica, sans-serif; width: 40px; float: left;'>".$row['products_id']."</div>";
echo "<div style='font-size: 12px; font-family: Arial, Helvetica, sans-serif; font-weight: bold; width: 370px;'>".$row['products_name']."</div>";
echo "<div style='font-size: 12px; font-family: Arial, Helvetica, sans-serif; width: 40px; float: right;'>".$row['products_price']."</div>";
echo "</div>";
}
?>
</body>
</html>
Bookmarks