0

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>
2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by muralikalpana
0

$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);

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.