PHP 5.6.0 released

ibase_blob_echo

(PHP 5)

ibase_blob_echoOutput blob contents to browser

Description

bool ibase_blob_echo ( string $blob_id )
bool ibase_blob_echo ( resource $link_identifier , string $blob_id )

This function opens a BLOB for reading and sends its contents directly to standard output (the browser, in most cases).

Parameters

link_identifier

An InterBase link identifier. If omitted, the last opened link is assumed.

blob_id

Return Values

Returns TRUE on success or FALSE on failure.

See Also

add a note add a note

User Contributed Notes 1 note

up
-1
int21h
3 years ago
here is an example if image.php

<?php
if (isset($_REQUEST['imageid']) AND $_REQUEST['imageid']>0) {
   
$db = 'host:/var/db/mydb.fdb';
   
$dbusername = 'sysdba';
   
$dbpassword = 'masterkey';
   
$query = "SELECT IMAGEDATA, MIME FROM IMAGES WHERE IMAGEID=".$_REQUEST['imageid'];
   
$dbh = ibase_connect($db, $dbusername, $dbpassword, 'UTF8') or die('Couldn't connect DB');
    $result = ibase_query($query);   
    $data = ibase_fetch_object($result);
    if ($data)
    {
        header("Content-type: ".$data->MIME);
        ibase_blob_echo ($data->IMAGEDATA);
    }
    ibase_close($dbh);
}
?>
To Top