note 104743 deleted from function.ibase-blob-echo by sobak

From: Date: Fri, 02 Dec 2016 08:21:13 +0000
Subject: note 104743 deleted from function.ibase-blob-echo by sobak
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-207943@lists.php.net to get a copy of this message
Note Submitter: int21h ---- 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); } ?>

« previous php.notes (#207943) next »