it keep on printing 1st image from database. but i want to print all the differenct images.

$id = $_SESSION['user_id']; 

//select images from database
    $sql = "SELECT * FROM image WHERE user_id = $id ORDER BY image_id DESC";
    $result = mysql_query($sql);

while($row = mysql_fetch_assoc($result))
{
    <img src="image.php?id='.$row['image_id'].'" />
}






    image.php
    <?php
    session_start();
    include("connect.php");

    $user_id = $_SESSION['user_id']; 

    $image = mysql_query("SELECT * FROM image WHERE user_id = $user_id ");
    $image = mysql_fetch_assoc($image); //get access to image table
    $image = $image['image'];
    echo base64_decode($image); 
?>

i was think on my image.php file where it say echo ;

echo base64_decode($image);

right after that i can some how go to next row?

I think you have first save to file on server with a temporary name.

 while($row = mysql_fetch_assoc($result))
{    
    $filename = SaveToFile($row['image_id']);
    <img src="image.php?id='.$filename.'" />
 }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.