PHP Doku:: Read a BLOB from the database - function.fbsql-read-blob.html

Verlauf / Chronik / History: (1) anzeigen

Sie sind hier:
Doku-StartseitePHP-HandbuchFunktionsreferenzDatenbankerweiterungenAnbieterspezifische DatenbankerweiterungenFrontBaseFrontBase Funktionenfbsql_read_blob

Ein Service von Reinhard Neidl - Webprogrammierung.

FrontBase Funktionen

<<fbsql_query

fbsql_read_clob>>

fbsql_read_blob

(PHP 4 >= 4.2.0, PHP 5)

fbsql_read_blobRead a BLOB from the database

Beschreibung

string fbsql_read_blob ( string $blob_handle [, resource $link_identifier ] )

Reads BLOB data from the database.

If a select statement contains BLOB and/or CLOB columns FrontBase will return the data directly when data is fetched. This default behavior can be changed with fbsql_set_lob_mode() so the fetch functions will return handles to BLOB and CLOB data. If a handle is fetched a user must call fbsql_read_blob() to get the actual BLOB data from the database.

Parameter-Liste

blob_handle

A BLOB handle, returned by fbsql_create_blob().

link_identifier

Eine von fbsql_connect() oder fbsql_pconnect() zurückgegebe FrontBase-Verbindung.

Wenn optional und nicht angegeben, wird versucht, eine bereits geöffnete FrontBase-Verbindung zu finden, falls keine vorhanden ist, wird versucht, eine zu öffnen, als ob fbsql_connect() ohne Parameter aufgerufen wurde.

Rückgabewerte

Returns a string containing the specified BLOB data.

Beispiele

Beispiel #1 fbsql_read_blob() example

<?php
$link 
fbsql_pconnect("localhost""_SYSTEM""secret")
    or die(
"Could not connect");
$sql "SELECT BLOB_COLUMN FROM BLOB_TABLE;";
$rs fbsql_query($sql$link);
$row_data fbsql_fetch_row($rs);
// $row_data[0] will now contain the blob data for the first row
fbsql_free_result($rs);

$rs fbsql_query($sql$link);
fbsql_set_lob_mode($rsFBSQL_LOB_HANDLE);
$row_data fbsql_fetch_row($rs);
// $row_data[0] will now contain a handle to the BLOB data in the first row
$blob_data fbsql_read_blob($row_data[0]);
fbsql_free_result($rs);

?>

Siehe auch


Keine BenutzerBeiträge.
- Beiträge aktualisieren...



PHP Powered Diese Seite bei php.net
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)