note 18356 added to function.ibase-query
| From: | eric_cavalcanti at hotmail dot com | Date: | Sat, 19 Jan 2002 17:11:01 +0000 |
| Subject: | note 18356 added to function.ibase-query | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-25161@lists.php.net to get a copy of this message | ||
Using BLOB
Insert BLOB:
/* create blob */
$blob_id = ibase_blob_create();
/* fill blob */
ibase_blob_add($blob_id, $var_datablob);
/* close new blob */
$blob_id_str = ibase_blob_close($blob_id);
/* insert into table */
ibase_query("INSERT INTO BLOB_TABLE (ID, BLOB) VALUES (1, ?)",$blob_id_str);
Open BLOB:
/* query */
$set = ibase_query("SELECT BLOB FROM BLOB_TABLE WHERE ID = 1");
/* fetche a row */
$row = ibase_fetch_object($set);
/* open BLOB for read */
$blob_id = ibase_blob_open($row->BLOB);
/* get BLOB data */
$stringBLOB = ibase_blob_get($blob_id);
/* print BLOB */
echo $stringBLOB;
/* close new blob */
ibase_blob_close($blob_id);
/* free result */
ibase_free_result($set);
--
http://www.php.net/manual/en/function.ibase-query.php
http://master.php.net/manage/user-notes.php?action=edit+18356
http://master.php.net/manage/user-notes.php?action=delete+18356
http://master.php.net/manage/user-notes.php?action=reject+18356