本文整理汇总了PHP中moodle_database::begin_sql方法的典型用法代码示例。如果您正苦于以下问题:PHP moodle_database::begin_sql方法的具体用法?PHP moodle_database::begin_sql怎么用?PHP moodle_database::begin_sql使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类moodle_database
的用法示例。
在下文中一共展示了moodle_database::begin_sql方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: begin_sql
/**
* on DBs that support it, switch to transaction mode and begin a transaction
* you'll need to ensure you call commit_sql() or your changes *will* be lost.
*
* this is _very_ useful for massive updates
*/
public function begin_sql()
{
if (!parent::begin_sql()) {
return false;
}
$sql = "BEGIN ISOLATION LEVEL READ COMMITTED";
$this->query_start($sql, NULL, SQL_QUERY_AUX);
$result = pg_query($this->pgsql, $sql);
$this->query_end($result);
pg_free_result($result);
return true;
}
示例2: begin_sql
public function begin_sql()
{
if (!parent::begin_sql()) {
return false;
}
$this->adodb->BeginTrans();
return true;
}
示例3: begin_sql
/**
* on DBs that support it, switch to transaction mode and begin a transaction
* you'll need to ensure you call commit_sql() or your changes *will* be lost.
*
* this is _very_ useful for massive updates
*/
public function begin_sql()
{
if (!parent::begin_sql()) {
return false;
}
$sql = "SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED";
$this->query_start($sql, NULL, SQL_QUERY_AUX);
$result = $this->mysqli->query($sql);
$this->query_end($result);
$sql = "BEGIN";
$this->query_start($sql, NULL, SQL_QUERY_AUX);
$result = $this->mysqli->query($sql);
$this->query_end($result);
return true;
}
示例4: begin_sql
public function begin_sql()
{
if (!parent::begin_sql()) {
return false;
}
$this->query_start('', NULL, SQL_QUERY_AUX);
$result = true;
try {
$this->pdb->beginTransaction();
} catch (PDOException $ex) {
$this->lastError = $ex->getMessage();
$result = false;
}
$this->query_end($result);
return $result;
}
示例5: begin_sql
/**
* on DBs that support it, switch to transaction mode and begin a transaction
* you'll need to ensure you call commit_sql() or your changes *will* be lost.
*
* this is _very_ useful for massive updates
*/
public function begin_sql()
{
if (!parent::begin_sql()) {
return false;
}
return true;
$sql = "BEGIN";
$this->query_start($sql, NULL, SQL_QUERY_AUX);
$stmt = $this->parse_query($sql);
$result = oci_execute($stmt);
$this->query_end($result, $stmt);
oci_free_statement($stmt);
return true;
}