Firebird 2.0
PHP5 Programming
Manual

FBIRD_BLOB_CLOSE

Purpose

Use the fbird_blob_close function to close a blob handle

Syntax

<blob_close> ::=
   fbird_blob_close(blb_hndl)


Element 
Type
Description
blb_hndl
resource
A valid blob handle
<return>
mixed
True or a blob ID string on success, False on failure

Semantics

This function closes a blob that has either been opened for reading by the ibase_open_blob function or has been opened for writing by the ibase_create_blob function

If the blob was being read, this function returns true on success, if the blob was being written to, this function returns a string containing the blob ID that has been assigned to it by the database. On failure, this function returns false.

Example

The below example creates a blob, fills it with data and inserts it into a table:

dbh = fbird_connect($host, $user, $pass);

$blh = fbird_blob_create($dbh);
fbird_blob_add($blh, $data);
$blobid = ibase_blob_close($blh);

$sql = "INSERT INTO blobtable(blobfield) VALUES (?)";
$sth = fbird_query($dbh, $sql, $blobid);



See also

fbird_create_blob, fbird_open_blob


previous page goto index next page

Legal information