当前位置: 首页>>代码示例>>PHP>>正文


PHP oci_commit函数代码示例

本文整理汇总了PHP中oci_commit函数的典型用法代码示例。如果您正苦于以下问题:PHP oci_commit函数的具体用法?PHP oci_commit怎么用?PHP oci_commit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了oci_commit函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actualizarPassword

function actualizarPassword($newpassword, $token)
{
    $conex = DataBase::getInstance();
    $stid = oci_parse($conex, "UPDATE FISC_USERS SET \n\t\t\t\t\t\tpassword=:newpassword\n\t\t\t\t    WHERE token=:token");
    if (!$stid) {
        oci_free_statement($stid);
        oci_close($conex);
        return false;
    }
    // Realizar la lógica de la consulta
    oci_bind_by_name($stid, ':token', $token);
    oci_bind_by_name($stid, ':newpassword', $newpassword);
    $r = oci_execute($stid, OCI_NO_AUTO_COMMIT);
    if (!$r) {
        oci_free_statement($stid);
        oci_close($conex);
        return false;
    }
    $r = oci_commit($conex);
    if (!$r) {
        oci_free_statement($stid);
        oci_close($conex);
        return false;
    }
    oci_free_statement($stid);
    // Cierra la conexión Oracle
    oci_close($conex);
    return true;
}
开发者ID:vanckruz,项目名称:draftReports,代码行数:29,代码来源:Controller_password.php

示例2: insertImage

function insertImage($conn, $photo_id, $owner_name, $descriptive_info, $thumbnail, $photo)
{
    $photo_blob = oci_new_descriptor($conn, OCI_D_LOB);
    $thumbnail_blob = oci_new_descriptor($conn, OCI_D_LOB);
    $subject = $descriptive_info[0];
    $place = $descriptive_info[1];
    $date_time = $descriptive_info[2];
    $description = $descriptive_info[3];
    $permitted = $descriptive_info[4];
    $sql = 'INSERT INTO images (photo_id, owner_name, permitted, subject, place,
		timing, description, thumbnail, photo) VALUES (:photoid, :ownername,
		:permitted, :subject, :place, TO_DATE(:datetime, \'MM/DD/YYYY\'), :description, empty_blob(),
		empty_blob()) returning thumbnail, photo into :thumbnail, :photo';
    $stid = oci_parse($conn, $sql);
    oci_bind_by_name($stid, ':photoid', $photo_id);
    oci_bind_by_name($stid, ':ownername', $owner_name);
    oci_bind_by_name($stid, ':permitted', $permitted);
    oci_bind_by_name($stid, ':subject', $subject);
    oci_bind_by_name($stid, ':place', $place);
    oci_bind_by_name($stid, ':datetime', $date_time);
    oci_bind_by_name($stid, ':description', $description);
    oci_bind_by_name($stid, ':thumbnail', $thumbnail_blob, -1, OCI_B_BLOB);
    oci_bind_by_name($stid, ':photo', $photo_blob, -1, OCI_B_BLOB);
    $res = oci_execute($stid, OCI_DEFAULT);
    if ($thumbnail_blob->save($thumbnail) && $photo_blob->save($photo)) {
        oci_commit($conn);
    } else {
        oci_rollback($conn);
    }
    oci_free_statement($stid);
    $photo_blob->free();
    $thumbnail_blob->free();
}
开发者ID:ismailmare,项目名称:Photoshare,代码行数:33,代码来源:uploadDB.php

示例3: obtenerDenuncias

function obtenerDenuncias($denuncias)
{
    //$ids = transformarArray($denuncias,",");
    $conex = DataBase::getInstance();
    foreach ($denuncias as $key => $value) {
        $conex = DataBase::getInstance();
        $stid = oci_parse($conex, "UPDATE FISC_DENUNCIAS SET \n\t\t\t\t\tASIGNACION=1 , ASIGNADOPOR=:sesion_cod\n\t\t\t\t\tWHERE ID_DENUNCIA=:ID");
        if (!$stid) {
            oci_free_statement($stid);
            oci_close($conex);
            return false;
        }
        // Realizar la lógica de la consulta
        oci_bind_by_name($stid, ':ID', $value);
        oci_bind_by_name($stid, ':sesion_cod', $_SESSION['USUARIO']['codigo_usuario']);
        $r = oci_execute($stid, OCI_NO_AUTO_COMMIT);
        if (!$r) {
            oci_free_statement($stid);
            oci_close($conex);
            return false;
        }
        $r = oci_commit($conex);
        if (!$r) {
            oci_free_statement($stid);
            oci_close($conex);
            return false;
        }
        oci_free_statement($stid);
        // Cierra la conexión Oracle
        oci_close($conex);
    }
    return true;
}
开发者ID:vanckruz,项目名称:draftReports,代码行数:33,代码来源:Controller_Denuncia_Correo.php

示例4: createPicturesTableIfNeeded

 function createPicturesTableIfNeeded($db)
 {
     $table = 'pictures';
     $index = 'description_indx';
     $table = strtoupper($table);
     if (!$this->tableExists($db, $table)) {
         $sql = "CREATE TABLE {$table} (\n                picture_id int PRIMARY KEY,\n                name VARCHAR2(50) NOT NULL,\n                creation_date DATE,\n                upload_date DATE,\n                description VARCHAR2(1000),\n                image ORDSYS.ORDImage,\n                image_sig  ORDSYS.ORDImageSignature,\n                artist_fk int REFERENCES artists(artist_id),\n                artist_safety_level int,\n                museum_ownes_fk int REFERENCES museums(museum_id),\n                museum_exhibits_fk int REFERENCES museums(museum_id),\n                museum_exhibits_startdate date,\n                museum_exhibits_enddate date,\n                owner_fk int REFERENCES owners(owner_id)\n                )";
         $this->executeSql($db, $sql);
         $this->createSequence($db, $table . "_seq");
     }
     $index = strtoupper($index);
     if (!$this->indexExists($db, $index)) {
         //create index for description
         $sql = "begin\n                        ctx_ddl.create_preference('mylexer', 'BASIC_LEXER' );\n                        ctx_ddl.set_attribute ( 'mylexer', 'mixed_case', 'NO' );\n                    end;";
         echo "{$this->log} - {$sql} <br />";
         $stmt = oci_parse($db, $sql);
         oci_execute($stmt, OCI_NO_AUTO_COMMIT);
         $sql = "begin\n                        ctx_ddl.create_preference('mystore', 'BASIC_STORAGE');\n                       ctx_ddl.set_attribute('mystore', 'I_TABLE_CLAUSE', 'tablespace INDX');\n                       ctx_ddl.set_attribute('mystore', 'K_TABLE_CLAUSE', 'tablespace INDX');\n                       ctx_ddl.set_attribute('mystore', 'R_TABLE_CLAUSE', 'tablespace INDX');\n                       ctx_ddl.set_attribute('mystore', 'N_TABLE_CLAUSE', 'tablespace INDX');\n                       ctx_ddl.set_attribute('mystore', 'I_INDEX_CLAUSE', 'tablespace INDX');\n                       ctx_ddl.set_attribute('mystore', 'P_TABLE_CLAUSE', 'tablespace INDX');\n                    end;";
         echo "{$this->log} - {$sql} <br />";
         $stmt = oci_parse($db, $sql);
         oci_execute($stmt, OCI_NO_AUTO_COMMIT);
         $sql = "CREATE INDEX myIndex ON PICTURES ( DESCRIPTION )\n                       INDEXTYPE IS CTXSYS.CONTEXT\n                       PARAMETERS ( 'LEXER mylexer STORAGE mystore SYNC (ON COMMIT)' )";
         echo "{$this->log} - {$sql} <br />";
         $stmt = oci_parse($db, $sql);
         oci_execute($stmt, OCI_NO_AUTO_COMMIT);
         oci_commit($db);
     }
 }
开发者ID:GeorgesAlkhouri,项目名称:openmuseum,代码行数:28,代码来源:DbTableCreator.php

示例5: commit

 public function commit()
 {
     set_error_handler(static::getErrorHandler());
     $isSuccess = oci_commit($this->resource);
     restore_error_handler();
     return $isSuccess;
 }
开发者ID:jpina,项目名称:oci8,代码行数:7,代码来源:Oci8Connection.php

示例6: Execute

 /**
  *Execução de comandos padrões de consulta a banco (SELECT, INSERT, UPDATE, DELETE, CREATE...)
  *@name execute()
  *@return ObjectQuery
  **/
 public function Execute($argSql, $argName = NAME_QUERY)
 {
     global $result;
     # call the connect database method
     $sqli = $this->conn->__conecta();
     # instancia as variáveis
     $this->sql = $argSql;
     $this->name = $argName;
     //echo $this->dbtype;
     //exit;
     if ($this->conn->typedb == "mysql") {
         try {
             # execute sql command
             $result = $sqli->query($this->sql);
             # fecha a conexão com o banco de dados
             $sqli->close();
             # retorno do método
             return $result;
         } catch (Exception $e) {
             echo "<b>Erro de query: </b>" . $e->getMessage() . "\n <b>Linha: </b>" . $e->getLine() . "\n";
         }
     }
     if ($this->conn->typedb == "oracle") {
         try {
             $result = oci_parse($sqli, $this->sql);
             oci_execute($result);
             oci_commit($sqli);
             OCILogoff($sqli);
             return $result;
         } catch (Exception $e) {
             OCILogoff($sqli);
             echo "<b>Erro de query: </b>" . $e->getMessage() . "\n <b>Linha: </b>" . $e->getLine() . "\n";
         }
     }
 }
开发者ID:stagoe90,项目名称:InfinitumEprocurement,代码行数:40,代码来源:queryBuilder.class.php

示例7: uploadImage

/**
 * Insert image data to database (recoreded_data and thumbnail).
 * First generate an unique image id, then insert image to recoreded_data and resized image to thubnail along with 
 *   other given data
 */
function uploadImage($conn, $sensor_id, $date_created, $description)
{
    $image_id = generateId($conn, "images");
    if ($image_id == 0) {
        return;
    }
    $image2 = file_get_contents($_FILES['file_image']['tmp_name']);
    $image2tmp = resizeImage($_FILES['file_image']);
    $image2Thumbnail = file_get_contents($image2tmp['tmp_name']);
    // encode the stream
    $image = base64_encode($image2);
    $imageThumbnail = base64_encode($image2Thumbnail);
    $sql = "INSERT INTO images (image_id, sensor_id, date_created, description, thumbnail, recoreded_data)\n                      VALUES(" . $image_id . ", " . $sensor_id . ", TO_DATE('" . $date_created . "', 'DD/MM/YYYY hh24:mi:ss'), '" . $description . "', empty_blob(), empty_blob())\n                       RETURNING thumbnail, recoreded_data INTO :thumbnail, :recoreded_data";
    $result = oci_parse($conn, $sql);
    $recoreded_dataBlob = oci_new_descriptor($conn, OCI_D_LOB);
    $thumbnailBlob = oci_new_descriptor($conn, OCI_D_LOB);
    oci_bind_by_name($result, ":recoreded_data", $recoreded_dataBlob, -1, OCI_B_BLOB);
    oci_bind_by_name($result, ":thumbnail", $thumbnailBlob, -1, OCI_B_BLOB);
    $res = oci_execute($result, OCI_DEFAULT) or die("Unable to execute query");
    if ($recoreded_dataBlob->save($image) && $thumbnailBlob->save($imageThumbnail)) {
        oci_commit($conn);
    } else {
        oci_rollback($conn);
    }
    oci_free_statement($result);
    $recoreded_dataBlob->free();
    $thumbnailBlob->free();
    echo "New image is added with image_id ->" . $image_id . "<br>";
}
开发者ID:ayunita,项目名称:OOSproject,代码行数:34,代码来源:datacuratorFunction.php

示例8: commit

 public function commit()
 {
     if (!oci_commit($this->_dbh)) {
         throw OCI8Exception::fromErrorInfo($this->errorInfo());
     }
     return true;
 }
开发者ID:nvdnkpr,项目名称:symfony-demo,代码行数:7,代码来源:OCI8Connection.php

示例9: commit

 public function commit()
 {
     parent::commit();
     if (!oci_commit($this->link)) {
         $this->set_driver_error(null, PDO::ERRMODE_EXCEPTION, 'commit');
     }
     $this->setAttribute(PDO::ATTR_AUTOCOMMIT, 1);
     return true;
 }
开发者ID:Deepab23,项目名称:clinic,代码行数:9,代码来源:oci.php

示例10: commit

 public function commit()
 {
     if (!oci_commit($this->dbh)) {
         $error = oci_error($this->dbh);
         throw new \Exception($error['message'], $error['code']);
     }
     $this->executeMode = OCI_COMMIT_ON_SUCCESS;
     return true;
 }
开发者ID:df-arif,项目名称:df-core,代码行数:9,代码来源:PdoAdapter.php

示例11: commit

 public function commit()
 {
     if (oci_commit($this->connection)) {
         $this->autoCommit = true;
     } else {
         $e = oci_error($this->connection);
         throw new Sabel_Db_Exception_Driver($e["message"]);
     }
 }
开发者ID:reoring,项目名称:sabel,代码行数:9,代码来源:Driver.php

示例12: gagal__

 function gagal__($param, $conn)
 {
     $sql = "DELETE FROM MART_MST_CHKOUT WHERE MART_WR_ID = '{$param}'";
     $parse = oci_parse($conn, $sql);
     $exe = oci_execute($parse);
     if ($exe) {
         oci_commit($conn);
     }
 }
开发者ID:weltesdeveloper,项目名称:weltesmart,代码行数:9,代码来源:model_checkout.php

示例13: insertRow

 public function insertRow($t, $reqBody)
 {
     foreach ($reqBody as $req) {
         $i = "INSERT INTO {$t} VALUES ('{$req->id}', null, null, '{$req->l_name}', sysdate)";
         $resource = oci_parse($this->conn, $i);
         oci_execute($resource, OCI_NO_AUTO_COMMIT);
     }
     oci_commit($this->conn);
     //echo $req->id . "\n";
 }
开发者ID:romanovsky-vassar,项目名称:vassarapi-dev-0.1.0,代码行数:10,代码来源:OracleDatabase.php

示例14: UpdateRecord

 public function UpdateRecord($sql, $conn)
 {
     $status_update = false;
     $parse = oci_parse($sql, $conn);
     $execute = oci_execute($parse);
     if ($execute) {
         oci_commit($conn);
         $status_update = true;
     } else {
         oci_rollback($conn);
         $status_update = false . oci_error();
     }
     return $status_update;
 }
开发者ID:weltesdeveloper,项目名称:WeltesFinance,代码行数:14,代码来源:DbConfig.php

示例15: insert

 public function insert($sql)
 {
     $this->last_query = $sql;
     $this->stid = oci_parse($this->connection, $sql);
     oci_bind_by_name($this->stid, ":ID", $id, 32);
     $result = oci_execute($this->stid);
     $this->affected_rows_value = oci_num_rows($this->stid);
     $committed = oci_commit($this->connection);
     //$commited, result from commit currently not analyzed, space for improvement
     if ($result) {
         return $id;
     } else {
         return -1;
     }
 }
开发者ID:sergey-chekriy,项目名称:CRUD_Objects_Oracle_MySQL,代码行数:15,代码来源:oracle_database.php


注:本文中的oci_commit函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。