- Timestamp:
- 09/26/13 15:41:49 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/2.5.1-evolucao/phpgwapi/inc/adodb/drivers/adodb-ado.inc.php
r34 r8222 1 1 <?php 2 2 /* 3 V 4.94 23 Jan 2007 (c) 2000-2007 John Lim (jlim#natsoft.com.my). All rights reserved.3 V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). 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, … … 148 148 */ 149 149 150 function &MetaTables()150 function MetaTables() 151 151 { 152 152 $arr= array(); … … 170 170 } 171 171 172 function &MetaColumns($table)172 function MetaColumns($table, $normalize=true) 173 173 { 174 174 $table = strtoupper($table); … … 205 205 206 206 /* returns queryID or false */ 207 function &_query($sql,$inputarr=false)207 function _query($sql,$inputarr=false) 208 208 { 209 209 … … 222 222 $oCmd->CommandType = 1; 223 223 224 foreach($inputarr as $val) { 224 // Map by http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdmthcreateparam.asp 225 // Check issue http://bugs.php.net/bug.php?id=40664 !!! 226 while(list(, $val) = each($inputarr)) { 227 $type = gettype($val); 228 $len=strlen($val); 229 if ($type == 'boolean') 230 $this->adoParameterType = 11; 231 else if ($type == 'integer') 232 $this->adoParameterType = 3; 233 else if ($type == 'double') 234 $this->adoParameterType = 5; 235 elseif ($type == 'string') 236 $this->adoParameterType = 202; 237 else if (($val === null) || (!defined($val))) 238 $len=1; 239 else 240 $this->adoParameterType = 130; 241 225 242 // name, type, direction 1 = input, len, 226 $this->adoParameterType = 130; 227 $p = $oCmd->CreateParameter('name',$this->adoParameterType,1,strlen($val),$val); 228 //print $p->Type.' '.$p->value; 243 $p = $oCmd->CreateParameter('name',$this->adoParameterType,1,$len,$val); 244 229 245 $oCmd->Parameters->Append($p); 230 246 } … … 338 354 339 355 // returns the field object 340 function &FetchField($fieldOffset = -1) {356 function FetchField($fieldOffset = -1) { 341 357 $off=$fieldOffset+1; // offsets begin at 1 342 358 … … 588 604 $this->fields[] = (float) $f->value; 589 605 break; 606 case 11: //BIT; 607 $val = ""; 608 if(is_bool($f->value)) { 609 if($f->value==true) $val = 1; 610 else $val = 0; 611 } 612 if(is_null($f->value)) $val = null; 613 614 $this->fields[] = $val; 615 break; 590 616 default: 591 617 $this->fields[] = $f->value; … … 600 626 601 627 if ($this->fetchMode & ADODB_FETCH_ASSOC) { 602 $this->fields = &$this->GetRowAssoc(ADODB_ASSOC_CASE);628 $this->fields = $this->GetRowAssoc(ADODB_ASSOC_CASE); 603 629 } 604 630 return true;
Note: See TracChangeset
for help on using the changeset viewer.