FBIRD_BLOB_GET
Purpose
Use fbird_blob_get to retrieve data from a blob
that has been opened for reading.
Syntax
<fbird_blob_get>
::= fbird_blob_get( blb_hndl, size )
Element
|
Type
|
Description
|
blb_hndl
|
resource
|
A valid, open blob handle
|
size
|
integer
|
Number of bytes to retrieve
|
<result>
|
mixed
|
A string upon success, and False upon failure
|
Semantics
Use the fbird_blob_get function to retrieve a
certain number of bytes from the blob. Subsequent calls to
fbird_blob-get will return the following bytes. If there are no more
bytes in the blob, the function returns False. If the blob is empty,
an empty string will be returned on the first call.
You can use the fbird_blob_info function to
retrieve information about the type and size of the blob.
Note that you pass the IBASE_TEXT option to the
fbird_fetch functions, and have a (text) blob id automatically opened
and fetched.
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_info,
fbird_blob_open,
fbird_blob_close
|