It's my first day with php and I'm doing a select that returns me an image, how do I render this image. Here is my select and the image return:
class CooperMaisController {
public function getItens(){
$connect = OpenConnection();
$query = ibase_query($connect, " select * from CAD_PROD_PONTUACAO_RESGATE PP left join CAD_PRODUTOS CP on CP.EMPRESA = PP.EMPRESA and CP.CODIGO = PP.PRODUTO ");
if ($query){
$pagamentos = array();
while ($row = ibase_fetch_object($query)){
$pagamento = new coopermais();
$pagamento->setCodigo($row->CODIGO);
$pagamento->setPontuacao($row->PONTUACAO);
$pagamento->setNome($row->NOME);
$pagamento->setFoto($row->FOTO);
$pagamentos[] = $pagamento;
}
return $pagamentos;
} else {
return "Erro: ".ibase_errmsg();
}
unset($row);
unset($query);
ibase_close($connect);
}
}
When I give a var_dump
in the image I visualize this:
I'mgettingusedtoJavaScriptandnodewhereIsavedtheconvertedimagetothedatabaseasbase64(itwasahugestring),nowwithphpwhensavingtheimageappearsthis:
When I look at the XML the image is rendered.