<?php include "db.inc"; ?>

<html>
<head>
<title>A simple PHP view</title>
</head>

<body>
<h1>All Journal Entries</h1>
<?
 $entries=mysql_query("SELECT * FROM entries") or die ("Error querying journal entries");

 echo "<table width=\"100%\">\n";
 echo "<tr><td>Subject</td><td>Category</td><td>Created</td></tr>\n";

 while ( $rows = mysql_fetch_array($entries) ) { 
  echo "<tr>";
  echo "<td>".$rows['subject']."</td>";
  echo "<td>".$rows['category']."</td>";
  echo "<td>".date("F d, Y ",strtotime($rows['time_created']))."</td>";
  echo "</tr>\n";
 }
 echo "</table>";
?>
</body>
</html>