本文整理匯總了PHP中ADOCOnnection類的典型用法代碼示例。如果您正苦於以下問題:PHP ADOCOnnection類的具體用法?PHP ADOCOnnection怎麽用?PHP ADOCOnnection使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了ADOCOnnection類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: StartTrans
/**
Used together with StartTrans() to end a transaction. Monitors connection
for sql errors, and will commit or rollback as appropriate.
@autoComplete if true, monitor sql errors and commit and rollback as appropriate,
and if set to false force rollback even if no SQL error detected.
@returns true on commit, false on rollback.
*/
function CompleteTrans($autoComplete = true)
{
if ($this->transOff > 1) {
$this->transOff -= 1;
return true;
}
$this->raiseErrorFn = $this->_oldRaiseFn;
$this->transOff = 0;
if ($this->_transOK && $autoComplete) {
if (!$this->CommitTrans()) {
$this->_transOK = false;
if ($this->debug) {
ADOConnection::outp("Smart Commit failed");
}
} else {
if ($this->debug) {
ADOConnection::outp("Smart Commit occurred");
}
}
} else {
$this->_transOK = false;
$this->RollbackTrans();
if ($this->debug) {
ADOCOnnection::outp("Smart Rollback occurred");
}
}
return $this->_transOK;
}
示例2: CompleteTrans
function CompleteTrans($autoComplete = true)
{
if ($this->transOff > 1) {
$this->transOff -= 1;
return true;
}
$this->transOff = 0;
if ($this->transaction_status && $autoComplete) {
if (!$this->CommitTrans()) {
$this->transaction_status = false;
if ($this->debug) {
ADOConnection::outp("Smart Commit failed");
}
} else {
if ($this->debug) {
ADOConnection::outp("Smart Commit occurred");
}
}
} else {
$this->RollbackTrans();
if ($this->debug) {
ADOCOnnection::outp("Smart Rollback occurred");
}
}
return $this->transaction_status;
}