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);
}
?>