<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>Viewing Records</TITLE>
</HEAD>
<BODY>

<?php
include ("./header.inc");
?>
<center><img src=images/computer.gif border=0><font face=verdana size=3 color=darkred> Viewing Records from REVIEWS table</font></center><br>
<center>
<table width="500" border=1><tr align="justify" class="subtitle"><td>
  <p align="center">
  <img border="0" src="images/database.GIF" width="24" height="24"><font face=Verdana size=1><a href="./create_db.php">Create database</a>&nbsp;
  <img border="0" src="images/database.GIF" width="24" height="24"></font><a href="./delete_db.php"><font face=Verdana size=1>Delete database</font></a><font face="Verdana" size="1">&nbsp;
  <img border="0" src="images/Records.GIF" width="24" height="24"><a href="./create_menu.php">Create table</a>&nbsp;&nbsp;&nbsp;&nbsp;
  <img border="0" src="images/Records.GIF" width="24" height="24">&nbsp;
  </font> <a href="./add_menu.php"><font face=Verdana size=1>Add Record </font></a>  
  </p>
  <p align="center">&nbsp;<font face="Verdana" size="1"><img border="0" src="images/Records.GIF" width="24" height="24"></font><a href="./view_menu.php"><font face=verdana size=1>View Records</font></a>&nbsp;
  <font face="Verdana" size="1">&nbsp;&nbsp;&nbsp;
  <img border="0" src="images/Records.GIF" width="24" height="24"></font><a href="./del_menu.php"><font face=verdana size=1>Delete Record</font></a>
  <font face="Verdana" size="1">&nbsp;&nbsp;&nbsp;
  <img border="0" src="images/Records.GIF" width="24" height="24"></font> <a href="./upd_menu.php"><font face=verdana size=1>Update Record</font></a>&nbsp;
  <img border="0" src="images/home-to.GIF" width="24" height="24"><font face=verdana size=1>&nbsp; <a href="./index.php">Home</a></font>  </a></td></tr></table><br></center>
<?php
include("./config.php");
$table = "reviews";
$conn = @mysql_connect($server,$user,$password)
	or die("Unable to connect to SQL database...");
$rs = @mysql_select_db($database,$conn) 
	or die("Unable to select the database...Please press 'Create Database' to create new database.");
$sql = " SELECT * from $table order by pid";
$rs = mysql_query($sql,$conn)
	or die("Could not execute SQL query!!! Possibly SQL query already been executed.");
$list = "";

while($row = mysql_fetch_array($rs))
{
	$pid = $row["pid"];
	$pitem = $row["pitem"];
	$rating = $row["rating"];
	$title = $row["title"];
	$review = $row["review"];
	$dispname = $row["dispname"];
	$location = $row["location"];
	$date_added = $row["date_added"];
	$list.="<b><font face=verdana size=2>Product ID:</b>$pid<br><b>Product Item: </b> $pitem</font>";
	$list.="<br><b><font face=verdana size=2>Rating: $rating</b><br><b>Title: </b> $title</font>";
	$list.="<br><b><font face=verdana size=2>Review: </b> $review</font>";
	$list.="<br><b><font face=verdana size=2>Author: </b> $dispname<b><br>Location: </b> $location</font>";
	$list.="<br><b><font face=verdana size=2>Date: </b> $date_added</font><br><br>";
}
echo($list);
echo "<br><center><a href = view_menu.php><img src=images/back-to.gif border=0>  Back to view records menu</a></center>";
include("./your-footer.inc")
?>

</BODY>
</HTML>