Unable to retrieve picture on echo?

I am trying to echo a blob type data(images) from my database and i am not being able to show it as a whole pic but only the name of the picture on the result how can i retrieve one? Kindly somebody help me?? Code here :

  <table>
<tr>
   <th>Uploaded Image :</th>
  <td>$row->images</td>
 </tr></table>

Try this:


<td><?php echo $row->images ?> </td>

//or this shortcut


<td><?= $row->images ?> <td>

echo "<table>
<tr>
   <th>Uploaded Image :</th>
  <td>$row->images</td>
 </tr>
</table>";

I have done this already and i can retrieve too but the problem is not being able to view the picture it only shows the name of the file like this ->(pic.jpeg)

Blockquote

Ok,try this:



<td> <img src="<?= $row->images ?>" alt="#" ></td>

<offtopic>
Why does a variable named images (plural) contain the URL of one image (singular)? :thinking:
</offtopic>

1 Like

it worked but broken image!! Screenshot from 2020-03-07 15-15-33

Just reread your original post. I am not familiar with saving and rendering database blob images.

Perhaps another user can offer a solution.

I suppose there must be cases where blob images are an ideal solution but I far prefer the flexibility of storing links to images stored in a directory.

Edit:

Is it possible to supply a link to the web page. Maybe if the image width and height were specified it would solve the problem. Well worth a try.

Try this…

https://phppot.com/php/mysql-blob-using-php/

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.