Display BLOB text

Asked

Viewed 565 times

2

I have the following problem, in a report I need to display 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 using the cast to display but n was still. How to display the information for this blob field ?

1 answer

3


You can change the function of obtaining the data to ibase_fetch_assoc. It already has a parameter that causes it to show the data of the "Blobs" fields instead of the Ids. For this you must inform 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'];
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.