Display BLOB text

1

I am having the following problem, in a precise report displaying a field of the request that is as BLOB. And when I run the search it returns a strange code instead of the field information.

$sql = ibase_query("SELECT CAST(OBSERVACAO AS CHAR(80))
                            FROM TB_PEDIDO_VENDA
                            WHERE ID_PEDIDO = $id");
      while ($row = ibase_fetch_row($sql)) {
        echo utf8_encode($row[0]);

I tried to use the cast to display but it still was not. How to display the information in this blob field?

    
asked by anonymous 30.10.2017 / 19:13

1 answer

1

You can change the function of obtaining the data to ibase_fetch_assoc . It already has a parameter that causes it to display data from the "Blobs" field instead of the Ids. For this you must enter in the second parameter: IBASE_TEXT .

$sql = ibase_query("SELECT OBSERVACAO FROM TB_PEDIDO_VENDA WHERE ID_PEDIDO = $id");
while ($row = ibase_fetch_assoc($sql, IBASE_TEXT)) {
  echo $row['OBSERVACAO'];
}
    
07.11.2017 / 17:58