note 30448 added to function.ibase-blob-get
| From: | sol at nospam dot example dot com | Date: | Tue, 18 Mar 2003 16:59:54 +0000 |
| Subject: | note 30448 added to function.ibase-blob-get | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-45468@lists.php.net to get a copy of this message | ||
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;
}
}
--
http://www.php.net/manual/en/function.ibase-blob-get.php
http://master.php.net/manage/user-notes.php?action=edit+30448
http://master.php.net/manage/user-notes.php?action=delete+30448
http://master.php.net/manage/user-notes.php?action=reject+30448