4 V4.22 15 Apr 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
5 Released under both BSD license and Lesser GPL library license.
6 Whenever there is any discrepancy between the two licenses,
7 the BSD license will take precedence.
10 MySQL code that supports transactions. For MySQL 3.23 or later.
11 Code from James Poon <jpoon88@yahoo.com>
13 Requires mysql client. Works on Windows and Unix.
16 include_once(ADODB_DIR."/drivers/adodb-mysql.inc.php");
18 class ADODB_mysqlt extends ADODB_mysql {
19 var $databaseType = 'mysqlt';
20 var $ansiOuter = true; // for Version 3.23.17 or later
21 var $hasTransactions = true;
25 if ($this->transOff) return true;
27 $this->Execute('SET AUTOCOMMIT=0');
28 $this->Execute('BEGIN');
32 function CommitTrans($ok=true)
34 if ($this->transOff) return true;
35 if (!$ok) return $this->RollbackTrans();
37 if ($this->transCnt) $this->transCnt -= 1;
38 $this->Execute('COMMIT');
39 $this->Execute('SET AUTOCOMMIT=1');
43 function RollbackTrans()
45 if ($this->transOff) return true;
46 if ($this->transCnt) $this->transCnt -= 1;
47 $this->Execute('ROLLBACK');
48 $this->Execute('SET AUTOCOMMIT=1');
54 class ADORecordSet_mysqlt extends ADORecordSet_mysql{
55 var $databaseType = "mysqlt";
57 function ADORecordSet_mysqlt($queryID,$mode=false) {
58 return $this->ADORecordSet_mysql($queryID,$mode);
63 if ($this->EOF) return false;
66 // using & below slows things down by 20%!
67 $this->fields = @mysql_fetch_array($this->_queryID,$this->fetchMode);
68 if ($this->fields) return true;