Display image from sql

前端 未结 5 576
星月不相逢
星月不相逢 2021-01-22 13:52

I\'ve create a table where I\'ve saved images through \"BLOB\". I need to show those images along with other items. But I don\'t know how to show those images together in the sa

5条回答
  •  暖寄归人
    2021-01-22 14:39

    In case you still want to save your images in database, you will need second script which will get those images from database and pass them to browser with correct headers.

    header("Content-type: image/jpeg");
    # 
    # Replace this with database read:
    # readfile('myimage.jpg');
    

    Also, you will need to store what kind of image u use. There will be different header for JPEG, GIF or PNG file.

提交回复
热议问题