Documentation TYPO3 par Ameos

adodb-borland_ibase.inc.php

00001 <?php
00002 /* 
00003 V4.93 10 Oct 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         
00024         function ADODB_borland_ibase()
00025         {
00026                 $this->ADODB_ibase();
00027         }
00028         
00029         function BeginTrans()
00030         {        
00031                 if ($this->transOff) return true;
00032                 $this->transCnt += 1;
00033                 $this->autoCommit = false;
00034                 $this->_transactionID = ibase_trans($this->ibasetrans, $this->_connectionID);
00035                 return $this->_transactionID;
00036         }
00037         
00038         function ServerInfo()
00039         {
00040                 $arr['dialect'] = $this->dialect;
00041                 switch($arr['dialect']) {
00042                 case '': 
00043                 case '1': $s = 'Interbase 6.5, Dialect 1'; break;
00044                 case '2': $s = 'Interbase 6.5, Dialect 2'; break;
00045                 default:
00046                 case '3': $s = 'Interbase 6.5, Dialect 3'; break;
00047                 }
00048                 $arr['version'] = '6.5';
00049                 $arr['description'] = $s;
00050                 return $arr;
00051         }
00052         
00053         // Note that Interbase 6.5 uses ROWS instead - don't you love forking wars!
00054         //              SELECT col1, col2 FROM table ROWS 5 -- get 5 rows 
00055         //              SELECT col1, col2 FROM TABLE ORDER BY col1 ROWS 3 TO 7 -- first 5 skip 2
00056         // Firebird uses
00057         //              SELECT FIRST 5 SKIP 2 col1, col2 FROM TABLE
00058         function &SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0)
00059         {
00060                 if ($nrows > 0) {
00061                         if ($offset <= 0) $str = " ROWS $nrows "; 
00062                         else {
00063                                 $a = $offset+1;
00064                                 $b = $offset+$nrows;
00065                                 $str = " ROWS $a TO $b";
00066                         }
00067                 } else {
00068                         // ok, skip 
00069                         $a = $offset + 1;
00070                         $str = " ROWS $a TO 999999999"; // 999 million
00071                 }
00072                 $sql .= $str;
00073                 
00074                 return ($secs2cache) ? 
00075                                 $this->CacheExecute($secs2cache,$sql,$inputarr)
00076                         :
00077                                 $this->Execute($sql,$inputarr);
00078         }
00079         
00080 };
00081  
00082 
00083 class  ADORecordSet_borland_ibase extends ADORecordSet_ibase {  
00084         
00085         var $databaseType = "borland_ibase";            
00086         
00087         function ADORecordSet_borland_ibase($id,$mode=false)
00088         {
00089                 $this->ADORecordSet_ibase($id,$mode);
00090         }
00091 }
00092 ?>


Généré par TYPO3 Ameos avec  doxygen 1.4.6