I have a field of type BLOB to save images in my mysql, the image comes from an android APP via POST, the way the BLOB string arrives I saved in the bank.
When I try to show the contents of this BLOB in a page, everything goes blank.
PHP code that I use to show the image:
<?php
//header('Content-Type: image/jpeg');
include('conexao.php');
include('funcoes.php');
$sqlImagem = "SELECT foto from combustivel_abastece;";
$consultaImagem = mysql_query($sqlImagem, $connection) or die (print "Erro TABELA consulta imagem <br>".mysql_error());
if ((mysql_num_rows($consultaImagem) > 0)) {
while($row = mysql_fetch_assoc($consultaImagem)) {
echo '<img src="data:image/bmp;base64,'.base64_encode( $row['foto'] ) .'" /> <br>';
}
}
?>
Detail: the same string that I send to mysql, if I try to show in Android APP, it works