I found examples like these:
$sql = "SELECT ID, CONTENTTYPE, BLOBSIZE, DATA,NAME ";
$sql.= " FROM OM_BLOB WHERE ID = 42";
$result = ibase_query($sql);
while ($row=ibase_fetch_object($result))
{
$blob_data = ibase_blob_info( $row->DATA);
$blob_hndl = ibase_blob_open($row->DATA);
$image = ibase_blob_get( $blob_hndl, $blob_data[0]);
}
but this won't work for large blobs.
One solution for big blobs is to retrieve them by chunks:
$sql = "SELECT ID, CONTENTTYPE, BLOBSIZE, DATA,NAME ";
$sql.= " FROM OM_BLOB WHERE ID = 42";
$result = ibase_query($sql);
while ($row=ibase_fetch_object($result))
{
$image = ibase_blob_get($blob_hndl,8192);
while($data = ibase_blob_get($blob_hndl, 8192)){
$image .= $data;
}
}