title: How to go product details page from product page
body: <p>I'm trying with a E-Commerce website. But I'm having trouble. I want that when I click in the view details link of a product, the details of the product will be shown on the <code>product_details.php</code> page. But I can't transfer the product id to the <code>product_details.php</code> page. 
  My code is here... </p>
  
  <pre><code>&lt;?php
    include ("include/header.php");
  ?&gt;
  
  &lt;?php
  mysql_connect("localhost", "root", "") or die("problem with Connection");
  mysql_select_db("finalproject");
  
  $per_page = 3;
  $pages_query = mysql_query("SELECT COUNT('product_id') FROM product");
  $pages = ceil(mysql_result($pages_query, 0) / $per_page);
  
  $page = (isset ($_GET['page'])) ? (int) $_GET['page'] : 1;
  $start = ($page - 1 ) * $per_page;
  $query = mysql_query("SELECT * FROM product LIMIT $start,$per_page");
  
  while ($query_row = mysql_fetch_assoc($query))
  { 
      echo "&lt;b&gt;$query_row[product_name]&lt;/b&gt;&lt;br&gt;";
      echo "&lt;b&gt;Brand : &lt;/b&gt; $query_row[product_brand] &lt;br&gt;";
      echo "&lt;b&gt;Description : &lt;/b&gt; $query_row[description] &lt;br&gt;";;
      echo "&lt;b&gt;Price : &lt;/b&gt; $query_row[price] &lt;br&gt;";
      echo ('&lt;a href="product_details.php?         id='.$query_row['product_id'].'"&gt;View details&lt;/a&gt;&lt;br&gt;&lt;br&gt;') ;
  ?&gt;
  &lt;form action="product_details.php?productId=&lt;?php echo $row['product_id'];?    &gt;&gt;" method="post"&gt;
  
  &lt;?php
  }
  $prev = $page - 1;
  $next = $page + 1;
  
  if (!($page &lt;=1))
  {
      echo "&lt;a href='buyproduct.php?page=$prev'&gt;Prev&lt;/a&gt; ";
  }
  
  if($pages &gt;= 1)
  {
      for ($x=1; $x&lt;=$pages; $x++)
      { 
          echo ($x == $page) ? '&lt;b&gt;&lt;a href="?page='.$x.' "&gt;'.$x.'&lt;/a&gt;&lt;/b&gt; ' :  '&lt;a href="?page='.$x.' "&gt;'.$x.'&lt;/a&gt; ';
      }
  }
  
  if (!($page &gt;= $pages))
  {
      echo "&lt;a href='buyproduct.php?page=$next'&gt;Next&lt;/a&gt; ";
  }
  ?&gt;
  
  &lt;?php
      include ("include/footer.php");
  ?&gt;
  </code></pre>
  
  <p>and my <code>product_details.php</code> is </p>
  
  <pre><code>&lt;?php
      include ("include/header.php");
  ?&gt;
  
  &lt;?php
  include ("database.php");
  $productId = $_GET['productId'];
  
  $sql = "SELECT * FROM product WHERE product_id = $productId";
  $result = mysql_query($sql);
  while($row = mysql_fetch_array($result))
  {
      echo "&lt;b&gt;$row[product_name]&lt;/b&gt;&lt;br&gt;";
      echo "&lt;b&gt;Brand : &lt;/b&gt; $row[product_brand] &lt;br&gt;";
      echo "&lt;b&gt;Description : &lt;/b&gt; $row[description] &lt;br&gt;";;
      echo "&lt;b&gt;Price : &lt;/b&gt; $row[price] &lt;br&gt;&lt;br&gt;";
      "&lt;br&gt;"; 
  }
  ?&gt;
  
  &lt;?php
      include ("include/footer.php");
  ?&gt;
  </code></pre>
  
  <p>and when running in the browser when clicking to viw details in <code>product_details.php</code> the error is  :</p>
  
  <blockquote>
    <p>Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\project2\product_details.php on line 17</p>
  </blockquote>
  
  <p>Now what can I do....</p>