function getImage($id){ header("Content-type: image/jpeg"); // tell system which type of data is comming. // it must be set appropriately. $query="select image from table where ID=$id"; $db= new DB(); //initialize Database Class. $result=$db->execQuery($query); //wrpper of mysql_query(). $arr=oci_fetch_array($result, OCI_RETURN_NULLS); $temp=$arr[0]->load(); echo $temp; }
Thursday, November 18, 2010
Retrieving Image from Oracle using PHP
Author: Originative
| Posted at: 5:15 AM |
Filed Under:
code samples,
oracle tutorial,
php tutorial
|
Storing image in Databases such as Oracle, MySQL is not recommended usually because it put an overload on Database engine and performance is compromised, but there are many scenarios when one had to put images in database mostly for security reasons. In this tutorial we will learn how to retrieve image or any other data which is serialized and saved in database, in our case database is Oracle and language we are using is PHP.
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment