Problem retrieving/updating data from InterBase

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

currently I'm working with an Interbase 6.0 database and I want to insert
some text (and eventually a picture) to a blob field. I've found the
following php code:

$bid = ibase_blob_create();
ibase_blob_add($bid, "test");
$comments_blob = ibase_blob_close($bid);
$sql = "UPDATE tblcontent SET Metadata=? WHERE id=1";
ibase_query($sql,$comments_blob);
ibase_commit();

When I try to retrieve this blobdata, I use the following code:

$set = ibase_query("SELECT Metadata FROM tblcontent WHERE ID = 1");
$row = ibase_fetch_object($set);
$blob_id = ibase_blob_open($row->Metadata);
$content = ibase_blob_get($blob_id);
ibase_blob_close($blob_id);
ibase_free_result($set);

$content returns an empty string.
I don't know if it goes wrong updating the data, or retrieving the data.
Can anybody help me out here....

Thanks in advance....

Vincent







-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux