2016-07-18 2 views
1

제품 이미지를 나열하고 팝업 fancybox로 자신의 갤러리를 표시하려고합니다. A는 데이터베이스 제품의 모든 이미지를 나열 할 수 있지만 이미지를 클릭하면 필터를 사용할 수 없습니다. 그것은 모든 사진을 보여줍니다.PHP 데이터베이스로 fancybox 사용

제발 나를 도와 줄 수 있어요. 안부

<?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']; 
      ?> 

<section class="flexslider"> 
<ul class="slides"> 
<?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)){ ?> 
<?php $imageFile2 = HTTP_RESIM.'product_image/'.$row_product_resim['image']; ?> 
<li><?php echo "<a href=\"$imageFile2\" rel=\"fancybox-gallery\" ><img src=\"$imageFile\" /></a>"; ?> </li> 
<?php } ?> 
</ul> 
</section> 

답변

1

이들 문서는 다음과 같이 사용한다 을 말한다.

<a class="fancybox" rel="group" href="big_image_1.jpg"><img src="small_image_1.jpg" alt="" /></a> 

따라서 앵커 태그에 "fancybox"클래스를 추가해야합니다.

편집 : mysql 함수를 사용해서는 안되며 구식이며 매우 안전하지 않습니다. PDO (http://php.net/manual/en/book.pdo.php) 또는 mysqli (http://php.net/manual/en/book.mysqli.php)를 살펴보십시오.

+0

고맙습니다. 문서를 읽었지만 ı는 SQL 쿼리를 entegrate 할 수 없습니다. –

관련 문제