title: Using fancybox with php database
body: <p>I am trying to list products images , and show their own gallery with popup fancybox. A can list all the images from database products but cant filter when clicking the image. It shows all photos.</p>
  
  <p>Can you help me please.
  Regards</p>
  
  <pre><code>&lt;?php $query_product = mysql_query("SELECT * FROM products WHERE status = '1' AND language_parent_id = '0' AND id = '".$row_product_id['product_id']."' ORDER BY sort_order");
    $row_product = mysql_fetch_array($query_product);
    $imageFile = HTTP_RESIM.'products/'.$row_product['image'];
              ?&gt;
  
  &lt;section class="flexslider"&gt;
  &lt;ul class="slides"&gt;
  &lt;?php $imageFile = HTTP_RESIM.'products/'.$row_product['image'];
  $query_resim = mysql_query("SELECT * FROM product_image WHERE product_id = '".$row_product['id']."' AND status = '1' ORDER BY sort_order"); 
  
  while($row_product_resim = mysql_fetch_array($query_resim)){ ?&gt;
  &lt;?php $imageFile2 = HTTP_RESIM.'product_image/'.$row_product_resim['image']; ?&gt;
  &lt;li&gt;&lt;?php echo "&lt;a href=\"$imageFile2\" rel=\"fancybox-gallery\" &gt;&lt;img src=\"$imageFile\" /&gt;&lt;/a&gt;"; ?&gt; &lt;/li&gt;
  &lt;?php } ?&gt;
  &lt;/ul&gt;
  &lt;/section&gt;
  </code></pre>