简体   繁体   English

PHP图像数据库blob

[英]php image database blob

need your help. 需要你的帮助。 I am able to upload image to database on a blob field. 我能够将图像上传到Blob字段上的数据库。 Now the question is I am not able to display it back, it just puts out a box with out the real image, what is that I am missing. 现在的问题是我无法将其显示回来,它只是打开了一个没有真实图像的盒子,我想念的是什么。 Here is the code. 这是代码。 images is the field that is declared as blob; images是声明为blob的字段;

$statement->bind_result($notes, $images, $image_type);
    $statement->fetch();
    echo $images;
    echo '<img rc="data:image/jpeg;base64,'.base64_encode($images).'"/>';

you missed src from img tag. 您错过了img标签中的src use src in place of rc 用src代替rc

  echo '<img src="data:image/jpeg;base64,'.base64_encode($images).'"/>';

您在属性src <img>标记中缺少“ r”:

echo '<img src="data:image/jpeg;base64,'.base64_encode($images).'"/>';

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM