$conn = OCILogon("user","pass","db");
//sample code to save image
$id = 1;
if (filesize($upfile) > 0){
$lob = OCINewDescriptor($conn, OCI_D_LO😎;
$stmt = OCIParse($conn,"insert into tbltest (id,text,image) values ($id,'',EMPTY_BLOB()) returning image into :image");
OCIBindByName($stmt, ':image', &$lob, -1, OCI_B_BLO😎;
OCIExecute($stmt, OCI_DEFAULT);
if($lob->savefile($upfile)){
OCICommit($conn);
//echo "Blob successfully uploaded\n";
} else{
//echo "Couldn't upload Blob\n";
}
OCIFreeDesc($lob);
OCIFreeStatement($stmt);
}
//sample code to retrieve image
$stmt = OCIParse($conn,"select image from tbltest where id = $id");
OCIExecute($stmt);
while(OCIFetchinto($stmt,&$row,OCI_ASSOC+OCI_RETURN_LOBS)){
Header("Content-length: ".strlen($row['IMAGE']));
echo $row['IMAGE'];
}
OCIFreeStatement($stmt);
OCILogoff($conn);