FBIRD_BLOB_CREATE
Purpose
Use fbird_blob_create to create a new blob to hold
large size data.
Syntax
<blob_create>
::= fbird_blob_create( [conn_hndl] )
Element
|
Type
|
Description
|
conn_hndl
|
resource
|
Variable identifier to receive the blob handle
|
<return>
|
mixed
|
A blob handle on success, false on failure
|
Semantics
The fbird_blob_create function creates a new blob
object for filling with data. It returns a blob object handle for
later use with ibase_blob_add or False on failure. This function
creates a Firebird “stream” blob, i.e. a blob that
presents itself as an unsegmented stream of bytes.
If a connection handle is not provided, then the
"default" connection will be used. The default connection
is assigned every time you call fbird_connect or fbird_pconnect, so
if you have multiple connections it will be whichever one was
connected last.
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_blob_add,
fbird_blob_close,
fbird_blob_cancel
|