trying to print last image from database. my image type is long blob.
note this is all one file.

 //first get the last id in database and get last image form database
    <?php
    $lastid = mysql_insert_id();                            
    $image = mysql_query("SELECT * FROM image WHERE user_id = $id ORDER BY image_id DESC");
    $image = mysql_fetch_assoc($image); //get access to image table
    $image = $image['image'];
    base64_decode($image); 
    ?>

    <body>
                // i want to print the image here. 
                //i was thinking some thing like this.
                //<img src="$image" />    but it doesnt work also echo $image dont work too
    </body>

$image = mysql_query("SELECT * FROM image WHERE user_id = $id ORDER BY image_id DESC");

in the above code form where you are getting $id value?

base64_decode($image); what is this?
write like this $image=base64_decode($image);

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.