I have a saved image in my mysql blob encoded in base 64. However, I can not display the image on a simple php page. Actually what I want is for the user to click on a product category, to be returned a search done in php that returns the values of the field and also the images of each product. It follows my php code that is returning a broken image on my page and not the image that is stored in my database. Please, I would like to find where the error is in my code.
<?php
require "conexao.php";
$sql = "SELECT * FROM produtos WHERE idProduto = 17;";
$result = mysqli_query($conexao, $sql) or die(mysql_error());
$row = mysqli_fetch_array($result);
echo '<img src="data:image/jpeg;base64,' . base64_encode( $row['imagemProduto1'] ) . '" />';
mysqli_close($conexao);
?>