mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
54 lines
No EOL
1.2 KiB
PHP
54 lines
No EOL
1.2 KiB
PHP
<?php
|
|
|
|
/*
|
|
V2.00 13 May 2002 (c) 2000-2002 John Lim (jlim@natsoft.com.my). All rights reserved.
|
|
Released under both BSD license and Lesser GPL library license.
|
|
Whenever there is any discrepancy between the two licenses,
|
|
the BSD license will take precedence.
|
|
Set tabs to 8.
|
|
|
|
MySQL code that supports transactions. For MySQL 3.23 or later.
|
|
Code from James Poon <jpoon88@yahoo.com>
|
|
|
|
Requires mysql client. Works on Windows and Unix.
|
|
*/
|
|
|
|
|
|
include_once(ADODB_DIR."/drivers/adodb-mysql.inc.php");
|
|
|
|
|
|
class ADODB_mysqlt extends ADODB_mysql {
|
|
var $databaseType = 'mysqlt';
|
|
|
|
function BeginTrans()
|
|
{
|
|
$this->Execute('SET AUTOCOMMIT=0');
|
|
$this->Execute('BEGIN');
|
|
return true;
|
|
}
|
|
|
|
function CommitTrans($ok=true)
|
|
{
|
|
if (!$ok) return $this->RollbackTrans();
|
|
$this->Execute('COMMIT');
|
|
$this->Execute('SET AUTOCOMMIT=1');
|
|
return true;
|
|
}
|
|
|
|
function RollbackTrans()
|
|
{
|
|
$this->Execute('ROLLBACK');
|
|
$this->Execute('SET AUTOCOMMIT=1');
|
|
return true;
|
|
}
|
|
|
|
}
|
|
|
|
class ADORecordSet_mysqlt extends ADORecordSet_mysql{
|
|
var $databaseType = "mysqlt";
|
|
|
|
function ADORecordSet_mysqlt($queryID) {
|
|
return $this->ADORecordSet_mysql($queryID);
|
|
}
|
|
}
|
|
?>
|