本文整理汇总了PHP中sqlsrv_commit函数的典型用法代码示例。如果您正苦于以下问题:PHP sqlsrv_commit函数的具体用法?PHP sqlsrv_commit怎么用?PHP sqlsrv_commit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sqlsrv_commit函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: transactionEnd
/**
* Commit everything inside this transaction so far
*/
public function transactionEnd()
{
$result = sqlsrv_commit($this->dbConn);
if (!$result) {
$this->databaseError("Couldn't commit the transaction.");
}
}
示例2: commitTransaction
public function commitTransaction()
{
if ($this->transactionOn) {
//$this->execute('COMMIT TRANSACTION');
sqlsrv_commit($this->connection);
$this->transactionOn = false;
}
}
示例3: trans_commit
function trans_commit()
{
if (!$this->trans_enabled) {
return TRUE;
}
// When transactions are nested we only begin/commit/rollback the outermost ones
if ($this->_trans_depth > 0) {
return TRUE;
}
return sqlsrv_commit($this->conn_id);
}
示例4: _sql_transaction
/**
* SQL Transaction
* @access private
*/
function _sql_transaction($status = 'begin')
{
switch ($status) {
case 'begin':
return sqlsrv_begin_transaction($this->db_connect_id);
break;
case 'commit':
return sqlsrv_commit($this->db_connect_id);
break;
case 'rollback':
return sqlsrv_rollback($this->db_connect_id);
break;
}
return true;
}
示例5: commit
/**
* 用于非自动提交状态下面的查询提交
* @access public
* @return boolean
*/
public function commit()
{
if ($this->transTimes > 0) {
$result = sqlsrv_commit($this->_linkID);
$this->transTimes = 0;
if (!$result) {
$this->error();
return false;
}
}
return true;
}
示例6: _commit
/**
* Commit a transaction and return to autocommit mode.
*
* @return void
* @throws Zend_Db_Adapter_Sqlsrv_Exception
*/
protected function _commit()
{
if (!sqlsrv_commit($this->_connection)) {
require_once 'Zend/Db/Adapter/Sqlsrv/Exception.php';
throw new Zend_Db_Adapter_Sqlsrv_Exception(sqlsrv_errors());
}
}
示例7: commit_transaction
public function commit_transaction()
{
sqlsrv_commit($this->connection);
}
示例8: _commit
protected function _commit()
{
return sqlsrv_commit($this->handle);
}
示例9: commit
/**
* @brief 커밋
**/
function commit($force = false)
{
if (!$force && ($this->is_connected == false || !$this->transaction_started)) {
return;
}
$this->transaction_started = false;
sqlsrv_commit($this->conn);
}
示例10: commit_transaction
/**
* Driver specific commit of real database transaction,
* this can not be used directly in code.
* @return void
*/
protected function commit_transaction()
{
$this->query_start('native sqlsrv_commit', NULL, SQL_QUERY_AUX);
$result = sqlsrv_commit($this->sqlsrv);
$this->query_end($result);
}
示例11: get_booking_info
/*if ($notify_by_email)
{
require_once "functions_mail.inc";
// Gather all fields values for use in emails.
$mail_previous = get_booking_info($id, FALSE);
// If this is an individual entry of a series then force the entry_type
// to be a changed entry, so that when we create the iCalendar object we know that
// we only want to delete the individual entry
if (!$series && ($mail_previous['rep_type'] != REP_NONE))
{
$mail_previous['entry_type'] = ENTRY_RPT_CHANGED;
}
}*/
sqlsrv_begin_transaction($conn);
$start_times = mrbsDelEntry('test', $id, $series, 1);
sqlsrv_commit($conn);
// [At the moment MRBS does not inform the user if it was not able to delete
// an entry, or, for a series, some entries in a series. This could happen for
// example if a booking policy is in force that prevents the deletion of entries
// in the past. It would be better to inform the user that the operation has
// been unsuccessful or only partially successful]
if ($start_times !== FALSE && count($start_times) > 0) {
// Send a mail to the Administrator
if ($notify_by_email) {
// Now that we've finished with mrbsDelEntry, change the id so that it's
// the repeat_id if we're looking at a series. (This is a complete hack,
// but brings us back into line with the rest of MRBS until the anomaly
// of del_entry is fixed)
if ($series) {
$mail_previous['id'] = $mail_previous['repeat_id'];
}
示例12: commit
/**
* Commits statements in a transaction.
* @param string optional savepoint name
* @return void
* @throws Dibi\DriverException
*/
public function commit($savepoint = NULL)
{
sqlsrv_commit($this->connection);
}
示例13: _commit
/**
* Commit a transaction and return to autocommit mode.
*
* @return void
* @throws \Zend\Db\Adapter\SqlsrvException
*/
protected function _commit()
{
if (!sqlsrv_commit($this->_connection)) {
throw new SqlsrvException(sqlsrv_errors());
}
}
示例14: transact
/**
* Call this function to perform any of the following operation - INSERT, UPDATE, DELETE, READ
* @param unknown $fieldValueArray - Associative Array
* array(
* 'Table'=> 'TableName', //Mandatory
* 'Fields'=> array( //Mandatory
* 'FieldName1' =>Value1,
* 'FieldName2' =>Value2,
* 'FieldName_n'=>Value_n
* )
* )
* @param unknown $operation - Type of operation : INSERT,UPDATE,DELETE,READ,INSERT_MR
* @param unknown $outputFormat - Values possible : ASSOC | NUM_ARR | NUM_ROWS . Optional parameter
*/
private function transact($fieldValueArray, $operation, $outputFormat = 'ASSOC')
{
$operation = strtoupper($operation);
$transactReturnCode = -1;
// Transaction Failed
$read = false;
switch ($operation) {
case 'INSERT':
$Query = $this->Prepare_Query($fieldValueArray, 'INSERT');
break;
case 'UPDATE':
$Query = $this->Prepare_Query($fieldValueArray, 'UPDATE');
break;
case 'DELETE':
$Query = $this->Prepare_Query($fieldValueArray, 'DELETE');
break;
case 'READ':
$Query = $this->Prepare_Query($fieldValueArray, 'READ');
$s = sqlsrv_query($this->dbconnection, $Query);
$output = $this->Prepare_Output($s, $outputFormat);
$transactReturnCode = $output;
sqlsrv_free_stmt($s);
$read = true;
break;
case 'INSERT_MR':
$tableName = $fieldValueArray['TABLE_NAME'];
$listOfID = $fieldValueArray['ID_LIST'];
$FieldsArray = $fieldValueArray['FIELD_DETAILS'];
$input_array = array('FIELD_ARRAY' => $FieldsArray, 'TABLE_NAME' => $tableName);
$Query = $this->Prepare_Query($fieldValueArray, 'INSERT_MR');
break;
}
if (!$read && sqlsrv_begin_transaction($this->dbconnection)) {
$s = sqlsrv_query($this->dbconnection, $Query);
if ($s) {
sqlsrv_commit($this->dbconnection);
$transactReturnCode = 0;
// Transaction Success
}
}
return $transactReturnCode;
}
示例15: dbTransactionCommit
/**
* Commits the sql transaction.
*
* @return boolean (Returns TRUE on success or FALSE on failure.)
*/
function dbTransactionCommit()
{
return sqlsrv_commit(Database::getConnection());
// Commits a transaction.
}