1
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 string BLOB arrives I saved in the bank.
When I try to show the contents of this BLOB on a page, everything is blank.
PHP code 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 the Android APP, it works