Your SQL query doesn't need that semicolon at the end of the query -- lose
it.
I never used ibase, so here's what I found from the PHP Manual page for
ibase_query:
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);
Peter
On Tue, 29 Oct 2002, David Russell wrote:
> Hi all,
>
> I have a file I need to insert into a blob in a interbase table. Code as
> follows:
>
> $filehandle = fopen($file, "r");
> $blob_id = ibase_blob_import($filehandle);
> $qry = "INSERT INTO BPFATTACHMENTS ";
> $qry = $qry . "(BPFATTACHMENTNO, BPF, ATTACHMENTTYPE, FILENAME,
> FILESIZE, ATTACHMENT)";
> $qry = $qry . "VALUES";
> $qry = $qry . "($bpfAttNo, $BPFNo, $AttachmentType, '$file_name',
> $file_size, ?);";
> $res = ibase_query($qry, $blob_id);
>
> I have a ibase_pconnect prior to this.
>
> The problem is that is only adds a tiny part of the file (ie 5k of the
> 200k file) What should I be looking for?
>
> Thanks
>
> David Russell
> IT Support Manager
> Barloworld Optimus (Pty) Ltd
> Tel: +2711 444-7250
> Fax: +2711 444-7256
> e-mail: [EMAIL PROTECTED]
> web: www.BarloworldOptimus.com
>
---------------------------------------------------------------------------
Peter Beckman Systems Engineer, Fairfax Cable Access Corporation
[EMAIL PROTECTED] http://www.purplecow.com/
---------------------------------------------------------------------------
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php