0

need your help. I am able to upload image to database on a blob field. 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;

$statement->bind_result($notes, $images, $image_type);
    $statement->fetch();
    echo $images;
    echo '<img rc="data:image/jpeg;base64,'.base64_encode($images).'"/>';
2
  • Well you cannot print the raw image and html together Commented Jun 15, 2016 at 4:01
  • so what is the fix or a solution to do what I am looking for. Commented Jun 15, 2016 at 15:53

2 Answers 2

1

you missed src from img tag. use src in place of rc

  echo '<img src="data:image/jpeg;base64,'.base64_encode($images).'"/>';
Sign up to request clarification or add additional context in comments.

Comments

0

you missing 'r' in your attribute src <img> tag :

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.