note 10168 modified in function.ocibindbyname by irchtml

From: Date: Tue, 02 Mar 2004 11:28:38 +0000
Subject: note 10168 modified in function.ocibindbyname by irchtml
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-66092@lists.php.net to get a copy of this message
to load an image from oracle: <? Header("Content-Type: image/png"); $conn = OCILogon("user","passwd","bd"); $stmt = OCIParse($conn,"select picture from table_with_picture "); $picture = OCINewDescriptor($stmt,OCI_D_LOB); OCIDefineByName($stmt,"PICTURE",&$picture); OCIExecute($stmt); while(OCIFetch($stmt)){ } OCIFreeStatement($stmt); $fp = fopen ("/directory/picture.tif","wb"); fwrite($fp,$picture); fclose($fp); passthru("/usr/bin/X11/convert /directory/picture.tif png:-"); ?> This work for blobs. --was-- to load an image from oracle: &lt;? Header("Content-Type: image/png"); $conn = OCILogon("user","passwd","bd"); $stmt = OCIParse($conn,"select picture from table_with_picture "); $picture = OCINewDescriptor($stmt,OCI_D_LOB); OCIDefineByName($stmt,"PICTURE",&$picture); OCIExecute($stmt); while(OCIFetch($stmt)){ } OCIFreeStatement($stmt); $fp = fopen ("/directory/picture.tif","wb"); fwrite($fp,$picture); fclose($fp); passthru("/usr/bin/X11/convert /directory/picture.tif png:-"); ?> This work for blobs. http://www.php.net/manual/en/function.ocibindbyname.php

« previous php.notes (#66092) next »