我发现了像这样的例子
`$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]);`
}
但是对于大型 BLOB 来说,这将无法正常工作。
对于大型 BLOB,一种解决方案是通过块来检索它们
`$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;`
}
}