Parse error: syntax error, unexpected $end in C:\xampp\htdocs\database.php on line 14
<p>I am new to php and learning it on my own. </p>

<p>I am getting the above error. I did try all that is suggested in google but not able  to solve. 
Need help. Not able to proceed further!!! </p>

<p>The 14th line would be  "$category = $category->fetch();"</p>

<pre><code>&lt;?php&gt;
require 'database.php';

//get category ID
$category_id = $_GET['category_id'];
if(!isset($category_id)) {
$category_id = 1;
}

//Get name for current category
$query = "SELECT * FROM categories
      WHERE categoryID = $category_id";
 $category = $db-&gt;query($query);
 $category = $category-&gt;fetch();
 $category_name = $category['categoryName'];

 //Get all categories
 $query = 'SELECT * FROM categories
      ORDER BY categoryID';
 $categories = $db-&gt;query($query);

 //Get all products for selected category
$query = "SELECT * FROM products 
     WHERE categoryID = $category_id
     ORDER BY productID";
 $products = $db-&gt;query($query);

?&gt;

 &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitionl.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;!--the head section --&gt;
&lt;head&gt;
&lt;title&gt;My Guitar Shop&lt;/title&gt;
&lt;link&gt;rel = "stylesheet" type ="text/css" href = main.css"/&gt;
&lt;/head&gt;

&lt;!-- the body section --&gt;
&lt;body&gt;
&lt;div id = "page"&gt;
&lt;div id = "main"&gt;

 &lt;h1&gt;Product List&lt;/h1&gt;
 &lt;div id = "sidebar"&gt; 

 &lt;!-- display a list of categories --&gt;
 &lt;h2&gt; Categories&lt;/h2&gt;
 &lt;ul class = "nav"&gt;
 &lt;?php foreach (categories as $category):?&gt;
 &lt;li&gt;
 &lt;a ref = "?category_id =&lt;?php echo $category['categoryID'];?&gt;"&gt;
 &lt;?php echo $category['categoryName'];?&gt;
 &lt;/a&gt;
 &lt;/li&gt;
 &lt;?php endforeach;?&gt;
 &lt;/ul&gt;
 &lt;/div&gt;

      &lt;div id = "content"&gt;
     &lt;!-- display a table of products --&gt;
 &lt;h2&gt;&lt;?php echo $category_name;?&gt;&lt;/h2&gt;
 &lt;table&gt;
 &lt;tr&gt;
    &lt;th&gt; Code&lt;/th&gt;
    &lt;th&gt;Name&lt;/th&gt;
    &lt;th class = "right"&gt;Price&lt;/th&gt;
 &lt;/tr&gt;

 &lt;?php foreach($products as $product):?&gt;
 &lt;tr&gt;
     &lt;td&gt;&lt;?php echo $product['productCode'];?&gt;&lt;/td&gt;
     &lt;td&gt;&lt;?php echo $product['productName'];?&gt;&lt;/td&gt;
     &lt;td class="right"&gt;&lt;?php echo $product['listPrice'];?&gt;&lt;/td&gt;
&lt;/tr&gt;
    &lt;?php endforeach;?&gt;
     &lt;/table&gt;   
&lt;/div&gt;
     &lt;div id ="footer"&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;!--end page--&gt;
  &lt;/body&gt;
 &lt;/html&gt;
</code></pre>
