Most Referenced Functions
  » google_pagerank()
  » preg_replace()
  » imagecreatefrompng()
  » site_pageranks()
  » imagepng()
  » imagedestroy()
  » imagestring()
  » imagecolorallocate()
  » htmlentities()
  » preg_match()
  » fopen()
  » header()
  » getimagesize()
  » preg_match_all()
  » session_start()
  » htmlspecialchars()
  » ob_start()
  » ob_flush()
  » strstr()
  » flush()
  » strpos()
  » setcookie()
  » str_replace()
  » array2vars()
  » nl2br()
  » preg_split()
  » ereg()
  » ereg_replace()
  » urlencode()
  » readgzfile()

Become a sponsor for $15/month. Link is sitewide - PR5 homepage, 20+ PR4 pages, 90+ PR3 pages. Email dave[AT]icemelon[D0T]c0m.

PHP Functions

Function: ocinewdescriptor

(PHP 3 >= 3.0.7, PHP 4, PHP 5)

ocinewdescriptor --  Initialize a new empty LOB or FILE descriptor

Description

OCI-Lob ocinewdescriptor ( resource connection [, int type] )

ocinewdescriptor() allocates storage to hold descriptors or LOB locators. Valid values for type are OCI_D_FILE , OCI_D_LOB and OCI_D_ROWID . For LOB descriptors, the methods load, save, and savefile are associated with the descriptor, for BFILE only the load method exists. See the second example usage hints.

Example 1. ocinewdescriptor() example

<?php   
    /* This script is designed to be called from a HTML form.
     * It expects $user, $password, $table, $where, and $commitsize
     * to be passed in from the form.  The script then deletes
     * the selected rows using the ROWID and commits after each
     * set of $commitsize rows. (Use with care, there is no rollback)
     */
    $conn = OCILogon($user, $password);
    $stmt = OCIParse($conn, "select rowid from $table $where");
    $rowid = OCINewDescriptor($conn, OCI_D_ROWID);
    OCIDefineByName($stmt, "ROWID", &$rowid);   
    OCIExecute($stmt);
    while (OCIFetch($stmt)) {
       $nrows = OCIRowCount($stmt);
       $delete = OCIParse($conn, "delete from $table where ROWID = :rid");
       OCIBindByName($delete, ":rid", &$rowid, -1, OCI_B_ROWID);
       OCIExecute($delete);      
       echo "$nrows\n";
       if (($nrows % $commitsize) == 0) {
           OCICommit($conn);      
       }   
    }
    $nrows = OCIRowCount($stmt);   
    echo "$nrows deleted...\n";
    OCIFreeStatement($stmt);  
    OCILogoff($conn);
?>
<?php
    /* This script demonstrates file upload to LOB columns
     * The formfield used for this example looks like this
     * <form action="upload.php" method="post" enctype="multipart/form-data">
     * <input type="file" name="lob_upload" />
     * ...
     */
  if (!isset($lob_upload) || $lob_upload == 'none'){
?>
<form action="upload.php" method="post" enctype="multipart/form-data">
Upload file: <input type="file" name="lob_upload" /><br />
<input type="submit" value="Upload" /> - <input type="reset" value="Reset" />
</form>
<?php
  } else {

     // $lob_upload contains the temporary filename of the uploaded file

Related Function(s)

  • oci_new_descriptor()
  • Icemelon -- PHP, CSS, Javascript Tutorials, & More!
      © 2005-2010 Icemelon.com   Email: dave[AT]icemelon[D0T]c0m