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