(PHP 4 >= 4.2.0, PHP 5 < 5.3.0)
fbsql_read_blob — Read a BLOB from the database
$blob_handle
, resource $link_identifier
= ?
) : stringReads BLOB data from the database.
If a select statement contains BLOB and/or CLOB columns FrontBase will return the data directly when data is fetched. This default behavior can be changed with fbsql_set_lob_mode() so the fetch functions will return handles to BLOB and CLOB data. If a handle is fetched a user must call fbsql_read_blob() to get the actual BLOB data from the database.
blob_handle
A BLOB handle, returned by fbsql_create_blob().
link_identifier
Um identificador de link FrontBase retornado porfbsql_connect() ou fbsql_pconnect().
Se opcional e não especificado a função tentará localizar um link aberto ao um servidor FrontBase e se nenhum link for encontrado será tentado criar um como se fbsql_connect() fosse chamado sem argumentos.
Returns a string containing the specified BLOB data.
Exemplo #1 fbsql_read_blob() example
<?php
$link = fbsql_pconnect("localhost", "_SYSTEM", "secret")
or die("Could not connect");
$sql = "SELECT BLOB_COLUMN FROM BLOB_TABLE;";
$rs = fbsql_query($sql, $link);
$row_data = fbsql_fetch_row($rs);
// $row_data[0] will now contain the blob data for the first row
fbsql_free_result($rs);
$rs = fbsql_query($sql, $link);
fbsql_set_lob_mode($rs, FBSQL_LOB_HANDLE);
$row_data = fbsql_fetch_row($rs);
// $row_data[0] will now contain a handle to the BLOB data in the first row
$blob_data = fbsql_read_blob($row_data[0]);
fbsql_free_result($rs);
?>