Subject | [firebird-php] Fast Imaging with Blob, an example |
---|---|
Author | Gerhard Knapp |
Post date | 2003-07-02T21:56:22Z |
hi,
i tried something to visualize a jpg, stored as a blob-type in firebird.
this is the fastest way i found
(no creating of any files on the webserver):
.............................
<?
$xgid= $_POST['x3'];
Header("Content-type: image/jpeg");
include "s89332211.php"; //dbserver, path, pw ....
ibase_connect($db_host, $db_user, $db_pwd, "WIN1252", NULL, 3);
$S = "SELECT FOTO1 FROM GSE WHERE GID = $xgid";
$Q = ibase_query($S);
$R = ibase_fetch_object($Q);
$BLOBID = ibase_blob_open($R->FOTO1);
while ($PIC = ibase_blob_get($BLOBID, 10240)) {
echo $PIC;
}
ibase_blob_close($BLOBID);
ibase_free_result($Q);
ibase_close;
?>
..............................
it works perfect und fast
best regards
Gerhard Knapp
gerhard.knapp@...
yahoo-id: prom_prometheus
i tried something to visualize a jpg, stored as a blob-type in firebird.
this is the fastest way i found
(no creating of any files on the webserver):
.............................
<?
$xgid= $_POST['x3'];
Header("Content-type: image/jpeg");
include "s89332211.php"; //dbserver, path, pw ....
ibase_connect($db_host, $db_user, $db_pwd, "WIN1252", NULL, 3);
$S = "SELECT FOTO1 FROM GSE WHERE GID = $xgid";
$Q = ibase_query($S);
$R = ibase_fetch_object($Q);
$BLOBID = ibase_blob_open($R->FOTO1);
while ($PIC = ibase_blob_get($BLOBID, 10240)) {
echo $PIC;
}
ibase_blob_close($BLOBID);
ibase_free_result($Q);
ibase_close;
?>
..............................
it works perfect und fast
best regards
Gerhard Knapp
gerhard.knapp@...
yahoo-id: prom_prometheus