0

I've stored a blob image in the database but I can't see it. I wrote this code

$queryi = "SELECT Foto  FROM bhk   WHERE Cod_Bhk = '".$Codice."' INTO DUMPFILE 'immagine.jpg'";

$resulti = mysqli_query($connessione_al_server,$queryi);

html code:

<img id="imgcaricata" class="mySlides" src="immagine.jpg" style="height:600px; width:auto;max-width:500px;">
Kampai
  • 22,848
  • 21
  • 95
  • 95

2 Answers2

0

This is valid if your blob has the mime type jpeg

echo '<img id="imgcaricata" class="mySlides"  
src="data:image/jpeg;base64,'.base64_encode( $resulti["Foto"] ).'" 
style="height:600px; width:auto;max-width:500px;" />';

Or try it with a separate php script like https://stackoverflow.com/a/7793098/5193536

nbk
  • 45,398
  • 8
  • 30
  • 47
0
<img src="data:image/jpeg;base64,<?php echo base64_encode(  $resulti["Foto"] ); ?>" id="imgcaricata" class="mySlides" style="height:600px; width:auto;max-width:500px;"/>
Wazan
  • 539
  • 1
  • 8
  • 27