Firebird 2.0
PHP5 Programming
Manual

FBIRD_BLOB_OPEN

Purpose

Use the fbird_blob_open function to open a blob for subsequent reading.

Syntax

<blob_open> ::=
   fbird_blob_open( [conn_hndl, ] blob_id )


Element 
Type
Description
conn_hndl
resource
A valid connection handle
blob_id
string
A valid blob id
<result>
mixed
A blob handle on success, or False on failure

Semantics

This function opens a blob for reading and returns a blob handle for subsequent use in the fbird_blob_get function.

If a connection handle is not provided, then the "default" connection will be used. The default connection is assigned every time you call fbird_connect or fbird_pconnect, so if you have multiple connections it will be whichever one was connected last.

This function returns a blob handle on success or False on failure.

Example

The below example fetches the first 4096 bytes from the selected blob, or all available bytes if less.

$sql = "SELECT blob_value FROM table ROWS 1 TO 1";
$result = ibase_query($sql);
$row = ibase_fetch_row($result);
$blob_hndl = ibase_blob_open($row[0]);
echo ibase_blob_get($blob_hndl, 4096);
ibase_blob_close($blob_hndl);



See also

fbird_blob_get, fbird_blob_echo


previous page goto index next page

Legal information