Documentation TYPO3 par Ameos |
00001 <?php 00002 /* 00003 V4.80 8 Mar 2006 (c) 2000-2006 John Lim (jlim@natsoft.com.my). All rights reserved. 00004 Released under both BSD license and Lesser GPL library license. 00005 Whenever there is any discrepancy between the two licenses, 00006 the BSD license will take precedence. 00007 Set tabs to 4 for best viewing. 00008 00009 Latest version is available at http://adodb.sourceforge.net 00010 00011 Support Borland Interbase 6.5 and later 00012 00013 */ 00014 00015 // security - hide paths 00016 if (!defined('ADODB_DIR')) die(); 00017 00018 include_once(ADODB_DIR."/drivers/adodb-ibase.inc.php"); 00019 00020 class ADODB_borland_ibase extends ADODB_ibase { 00021 var $databaseType = "borland_ibase"; 00022 00023 function ADODB_borland_ibase() 00024 { 00025 $this->ADODB_ibase(); 00026 } 00027 00028 function BeginTrans() 00029 { 00030 if ($this->transOff) return true; 00031 $this->transCnt += 1; 00032 $this->autoCommit = false; 00033 $this->_transactionID = ibase_trans($this->ibasetrans, $this->_connectionID); 00034 return $this->_transactionID; 00035 } 00036 00037 function ServerInfo() 00038 { 00039 $arr['dialect'] = $this->dialect; 00040 switch($arr['dialect']) { 00041 case '': 00042 case '1': $s = 'Interbase 6.5, Dialect 1'; break; 00043 case '2': $s = 'Interbase 6.5, Dialect 2'; break; 00044 default: 00045 case '3': $s = 'Interbase 6.5, Dialect 3'; break; 00046 } 00047 $arr['version'] = '6.5'; 00048 $arr['description'] = $s; 00049 return $arr; 00050 } 00051 00052 // Note that Interbase 6.5 uses ROWS instead - don't you love forking wars! 00053 // SELECT col1, col2 FROM table ROWS 5 -- get 5 rows 00054 // SELECT col1, col2 FROM TABLE ORDER BY col1 ROWS 3 TO 7 -- first 5 skip 2 00055 // Firebird uses 00056 // SELECT FIRST 5 SKIP 2 col1, col2 FROM TABLE 00057 function &SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0) 00058 { 00059 if ($nrows > 0) { 00060 if ($offset <= 0) $str = " ROWS $nrows "; 00061 else { 00062 $a = $offset+1; 00063 $b = $offset+$nrows; 00064 $str = " ROWS $a TO $b"; 00065 } 00066 } else { 00067 // ok, skip 00068 $a = $offset + 1; 00069 $str = " ROWS $a TO 999999999"; // 999 million 00070 } 00071 $sql .= $str; 00072 00073 return ($secs2cache) ? 00074 $this->CacheExecute($secs2cache,$sql,$inputarr) 00075 : 00076 $this->Execute($sql,$inputarr); 00077 } 00078 00079 }; 00080 00081 00082 class ADORecordSet_borland_ibase extends ADORecordSet_ibase { 00083 00084 var $databaseType = "borland_ibase"; 00085 00086 function ADORecordSet_borland_ibase($id,$mode=false) 00087 { 00088 $this->ADORecordSet_ibase($id,$mode); 00089 } 00090 } 00091 ?>