i5_getblob

 

Fetches binary data's from BLOB field type.

 

string i5_getblob (

resource result, int Field_Index )

or

string i5_getblob (

resource result, string Field_Name )

 

Details

 

i5_getblob function applies to SELECT type (i5_query or i5_execute) requests containing one or more BLOB type fields.

In the same way that i5_result function reads a unique field value, i5_getblob function allows to fetch binary data's.

The blob field value is read from the current record fetched by a previous call to i5_fetch_xxx function.

If field name or position do not matches with BLOB type, i5_getblob returns FALSE.

Warning: to read a blob it is necessary to be in transaction. To write a blob, file must also be journalized.

 

Parameters

 

result

File ID

position

BLOB field index

namfield

BLOB field name

 

Returns:

Returns string with BLOB binary chain or FALSE in case of fault.

 

I5_ERR_PHP_HDLDFT

256

No default connection found.

I5_ERR_PHP_OPTIONSTYPE

259

The type of " I5_OPTIONS_ALIAS" option must be x and not x

I5_ERR_PHP_OPTIONSNUMBER

260

Option number -1 is unknown.

I5_ERR_PHP_TYPEPARAM

262

Type of element x in parameter -1 must be y. Type z was provided.

I5_ERR_PHP_SPOOL_FILE_FOPEN

269

Internal Error on tempory file(x); code error : -1.

 

 

Example

 

     
$sql = "SELECT BLOB_COLUMN FROM BLOB_TABLE;";
$res = i5_query($sql);
$line = i5_fetch_row($res);

/* $line[0] contains blob ID */
/* this ID is used by Easycom for retrieve the BLOB data.*/
$blob_data = i5_getblob($res, 0);

/* the blob can be displayed or processed */

 

 

See also

 

i5_setblob