FBIRD_BLOB_ADD
Purpose
Use fbird_blob_add to add data to a newly created
blob object.
Syntax
<blob_add>
::= fbird_blob_add(blb_hndl, data)
Element
|
Type
|
Description
|
blb_hndl
|
resource
|
A valid blob handle open for writing
|
data
|
string
|
Data to be added
|
<return>
|
bool
|
Null on success, False on failure
|
Semantics
This function adds data to a new blob object
created with the fbird_create_ blob function. It can be called
multiple times; upon each call the data will be appended to the end
of the blob.
Once writing is complete, use the fbird_close_blob
function to finish the writing process and generate a blob ID string.
This ID string can be used to insert the blob object into a table
A blob under construction can be discarded through
the fbird_blob_cancel function.
Example
The below example creates a blob object, 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_blob_create,
fbird_blob_close,
fbird_blob_cancel
|