Changeset 34 for trunk/phpgwapi/inc/adodb/drivers/adodb-sybase.inc.php
- Timestamp:
- 06/29/07 15:17:46 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/phpgwapi/inc/adodb/drivers/adodb-sybase.inc.php
r2 r34 1 1 <?php 2 2 /* 3 V4. 51 29 July 2004 (c) 2000-2004John Lim. All rights reserved.3 V4.94 23 Jan 2007 (c) 2000-2007 John Lim. All rights reserved. 4 4 Released under both BSD license and Lesser GPL library license. 5 5 Whenever there is any discrepancy between the two licenses, … … 21 21 class ADODB_sybase extends ADOConnection { 22 22 var $databaseType = "sybase"; 23 //var $dataProvider = 'sybase';23 var $dataProvider = 'sybase'; 24 24 var $replaceQuote = "''"; // string to use to replace quotes 25 25 var $fmtDate = "'Y-m-d'"; … … 87 87 88 88 // http://www.isug.com/Sybase_FAQ/ASE/section6.1.html#6.1.4 89 function RowLock($tables,$where )89 function RowLock($tables,$where,$flds='top 1 null as ignore') 90 90 { 91 91 if (!$this->_hastrans) $this->BeginTrans(); 92 92 $tables = str_replace(',',' HOLDLOCK,',$tables); 93 return $this->GetOne("select top 1 null as ignorefrom $tables HOLDLOCK where $where");93 return $this->GetOne("select $flds from $tables HOLDLOCK where $where"); 94 94 95 95 } 96 96 97 function SelectDB($dbName) { 98 $this->databaseName = $dbName; 97 function SelectDB($dbName) 98 { 99 $this->database = $dbName; 100 $this->databaseName = $dbName; # obsolete, retained for compat with older adodb versions 99 101 if ($this->_connectionID) { 100 102 return @sybase_select_db($dbName); … … 106 108 Note: This function is NOT available for Microsoft SQL Server. */ 107 109 108 function ErrorMsg() 110 111 function ErrorMsg() 109 112 { 110 113 if ($this->_logsql) return $this->_errorMsg; 111 $this->_errorMsg = sybase_get_last_message(); 114 if (function_exists('sybase_get_last_message')) 115 $this->_errorMsg = sybase_get_last_message(); 116 else 117 $this->_errorMsg = isset($php_errormsg) ? $php_errormsg : 'SYBASE error messages not supported on this platform'; 112 118 return $this->_errorMsg; 113 119 } … … 152 158 return $rs; 153 159 } 154 $cnt = ($nrows > 0) ? $nrows : 0; 160 161 $nrows = (integer) $nrows; 162 $offset = (integer) $offset; 163 164 $cnt = ($nrows >= 0) ? $nrows : 999999999; 155 165 if ($offset > 0 && $cnt) $cnt += $offset; 156 166 157 167 $this->Execute("set rowcount $cnt"); 158 168 $rs =& ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,0); 159 $this->Execute("set rowcount 0"); 169 $this->Execute("set rowcount 0"); 160 170 161 171 return $rs; … … 284 294 if (!$mode) $this->fetchMode = ADODB_FETCH_ASSOC; 285 295 else $this->fetchMode = $mode; 286 return$this->ADORecordSet($id,$mode);296 $this->ADORecordSet($id,$mode); 287 297 } 288 298
Note: See TracChangeset
for help on using the changeset viewer.