-2
I need to make the code below not show the blob value of the image q was saved in the database, but show it in figure.jpg to list on the screen. how can I convert inside that same code?
<?php
require_once "conexao.class.php";
try
{
$conecta = new PDO('mysql:host=localhost;dbname=informacoes;charset=utf8', 'root', '');
$conecta->exec("set names utf8"); //permite caracteres latinos.
$consultaSQL = "SELECT imagem FROM escolhida1 WHERE 1";
$exComando = $conecta->prepare($consultaSQL); //testar o comando
$exComando->execute(array());
foreach($exComando as $resultado)
{
$png = "png";
$conteudo = $resultado['imagem'];
header("Content-Type: $png");
echo $conteudo;
}
}catch(PDOException $erro)
{
echo("Errrooooo! foi esse: " . $erro->getMessage());
}
?>
personal pardon, not jpg, in question, is PNG same
– Resyst