I am trying to write a PHP application that will display images stored in an Oracle DB of type Long Raw on an HTML page.
This much I have:
function ReturnBizPic($EmployeeNo) { include(EP_Root."includes/db.php"); $strSql = "SELECT Image From SHR.IMAGES Where Image_ID = (Select Image_ID From HRS.Employee_Master WHERE EMPLOYEE_NO = '".$EmployeeNo."')"; $rs = $dbora->Execute($strSql); $result = $rs->FetchRow(); $rs->close(); $dbora->close(); return $result["IMAGE"]; }
What do I do from here?
Thanks
Point an <IMG> element to a script that executes this function, e.g.
<img src="http://yoursite.com/pic.php?id=5">
pic.php:
$id = (int)$_GET['id']; header('Content-Type: image/jpeg'); // adjust this accordingly echo ReturnBizPic($id);