title: Retrieve blob field from oracle database using PHP
body: <p>I have a table with the following definition in oracle</p>
  
  <pre><code>file_id varchar2(20)
  file_content blob
  </code></pre>
  
  <p>Using the following PHP code I tried to retrieve the blob field but I get NULL</p>
  
  <pre><code>$file_id = '1324410597775';
  $content = strtoupper('file_content');
  $holder = ":holder";
  
  $conn = oci_connect("user","password","tstring");
  $sql = "select $holder from tbl_file_upload where file_id = '$file_id'";
  
  
  $parse = oci_parse($conn, $sql);
  
  oci_bind_by_name($parse, $holder, $content);
  
  oci_execute($parse);
  
  $row = oci_fetch_array($parse, OCI_RETURN_NULLS);
  $lob = null;
  if (is_object($row[$content])) {
       $lob = $row[$content]-&gt;load();
       $row[$content]-&gt;free();
       echo "Here";
  }
  </code></pre>
  
  <p>I followed the example in this link <a href="http://docs.oracle.com/cd/E17781_01/appdev.112/e18555/ch_twelve_blobs.htm" rel="nofollow">http://docs.oracle.com/cd/E17781_01/appdev.112/e18555/ch_twelve_blobs.htm</a></p>
  
  <p>I'd appreciate if anyone can point me in the right direction.</p>