0

Hello pal's i need some help. I wanted to apply lightbox jquery effect on image gallery php file. I'm retrieving images from database which were stored in longblob format. i can get that effect by giving id value manually but by giving the variable like $id it's not providing that lightbox effect.... please check the below code and give some suggestions.

<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>

in retrieve page follows

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;
    }
} 
4

1 回答 1

0
    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;
         }
    } 
于 2013-05-23T10:31:28.063 回答