0
It’s my first day with php and I’m doing a select that returns an image, as I do to render this image. Follow my select and the return of the image:
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’m getting used to Javascript and Node where saved the converted image in the database as base 64 (it was a huge string), now with php when saving the image appears this:
When I look at the XML the image is rendered.
The field is
BLOB
with thesub_type
asbinary
?– Guilherme Nascimento
Yes a Binary blob field with size 80, I can visualize the image perfectly in the bank.
– Erick Zanetti
80 is very little, will the image not truncated?
– Guilherme Nascimento