0

it is not showing the image when the query is made and when it is checked in the browser, some letters appear as a result

image blob

this is my code

<?php 
$con = new mysqli ('localhost', 'cualquiera', '123123','rier');
$datos = $con->query("SELECT * FROM fotos  ") ;?>
<?php  while ($user = $datos->fetch_assoc()){ ?>
<tr>  
<td class="xl80"><div align="center" class="style84"><a 
href="./autos/304862/304862.htm"><strong><?php echo $user['modelo'] ;?>
<?php echo $user['ubicacion'] ; ?></strong></a></div></td>
<td class="xl80"><div align="center" class="style84"><a 
href="./autos/304862/304862.htm"><strong><?php echo $user['anio'] ; ?> 
</strong></a></div></td>
<td class="xl80"><div align="center" class="style84"><a 
href="./autos/304862/304862.htm"><strong><?php echo $user['chasis'] ; ?> 
</strong></a></div></td>

<td class="xl80"><div align="center" class="style84"><a 
href="./autos/304862/304862.htm"><strong><?php echo $user['transmision'] 
; ?></strong></a></div></td>
<td class="xl80"><div align="center" class="style84"><a 
href="./autos/304862/304862.htm"><strong><?php echo $user['color'] ; ?> 
</strong></a></div></td>  
<td class="xl80"><div align="center" class="style84"><a 
href="./autos/304862/304862.htm"><strong><?php echo $user['estado'] ; ?> 
</strong></a></div></td>
<td class="xl80"><div align="center" class="style84"> <?  echo '<img 
src="data:image/jpeg;base64,'.base64_encode( $user['imagen'] ).'"/>'?>                                      
</div></td>
</tr>
<?} ?>

in this image you can see the result

enter image description here

1 Answers1

1

You need to be sure that's a valid Base64 value of the whole image, please have a look at this answer How to display Base64 images in HTML?

PekosoG
  • 246
  • 3
  • 9