0
안녕하세요, 저는 도움이 필요합니다. 이미지 갤러리 php 파일에 라이트 박스 jquery 효과를 적용하고 싶습니다. longblob 형식으로 저장된 데이터베이스에서 이미지를 검색하고 있습니다. 나는 id 값을 수동으로 주면 그 효과를 얻을 수 있지만 $ id와 같은 변수를주는 것은 라이트 박스 효과를 제공하지 않는다. 아래 코드를 확인하고 몇 가지 제안을 해주시기 바랍니다. 에서 라이트 박스를 적용하는 방법 데이터베이스에서 검색 한 이미지에 jquery 효과를 적용하는 방법
<div id="gallery">
<?php
$query = mysql_query("SELECT * FROM image_uploads") or die(mysql_error());
while($row = mysql_fetch_array($query)){
$id = $row['entry_id'];
?>
<ul>
<li>
<a href="img_retrieve.php?oid=$id" $('#gallery').lightBox();">
<img src="img_retrieve.php?sid=$id" width="72" height="72" alt="" />
</a>
</li>
</ul>
<?php
}
?>
</div>
페이지가
if(isset($_GET['sid'])){
$id = $_GET['sid'];
$run = mysql_query("SELECT * FROM image_uploads WHERE entry_id=$id") or die(mysql_error());
while($images = mysql_fetch_array($run)){
$image = $images['s_image'];
header("Content-type: image/jpeg");
echo $image;
}
}
if(isset($_GET['oid'])){
$id = $_GET['oid'];
$run = mysql_query("SELECT * FROM upload_images WHERE entry_id=$id") or die(mysql_error());
while($images = mysql_fetch_array($run))
$s_image = $images['s_image'];
header("Content-type: image/jpeg");
echo $s_image;
}
}