mirror of
https://github.com/ACSPRI/queXS
synced 2024-04-02 12:12:16 +00:00
Merged from McMasterReports branch
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.94 23 Jan 2007 (c) 2000-2007 John Lim (jlim#natsoft.com.my). All rights reserved.
|
||||
V5.08 6 Apr 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
the BSD license will take precedence.
|
||||
@@ -147,7 +147,7 @@ class ADODB_ado extends ADOConnection {
|
||||
|
||||
*/
|
||||
|
||||
function &MetaTables()
|
||||
function MetaTables()
|
||||
{
|
||||
$arr= array();
|
||||
$dbc = $this->_connectionID;
|
||||
@@ -169,7 +169,7 @@ class ADODB_ado extends ADOConnection {
|
||||
return $arr;
|
||||
}
|
||||
|
||||
function &MetaColumns($table)
|
||||
function MetaColumns($table)
|
||||
{
|
||||
$table = strtoupper($table);
|
||||
$arr = array();
|
||||
@@ -204,7 +204,7 @@ class ADODB_ado extends ADOConnection {
|
||||
|
||||
|
||||
/* returns queryID or false */
|
||||
function &_query($sql,$inputarr=false)
|
||||
function _query($sql,$inputarr=false)
|
||||
{
|
||||
|
||||
$dbc = $this->_connectionID;
|
||||
@@ -221,11 +221,27 @@ class ADODB_ado extends ADOConnection {
|
||||
$oCmd->CommandText = $sql;
|
||||
$oCmd->CommandType = 1;
|
||||
|
||||
foreach($inputarr as $val) {
|
||||
// Map by http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdmthcreateparam.asp
|
||||
// Check issue http://bugs.php.net/bug.php?id=40664 !!!
|
||||
while(list(, $val) = each($inputarr)) {
|
||||
$type = gettype($val);
|
||||
$len=strlen($val);
|
||||
if ($type == 'boolean')
|
||||
$this->adoParameterType = 11;
|
||||
else if ($type == 'integer')
|
||||
$this->adoParameterType = 3;
|
||||
else if ($type == 'double')
|
||||
$this->adoParameterType = 5;
|
||||
elseif ($type == 'string')
|
||||
$this->adoParameterType = 202;
|
||||
else if (($val === null) || (!defined($val)))
|
||||
$len=1;
|
||||
else
|
||||
$this->adoParameterType = 130;
|
||||
|
||||
// name, type, direction 1 = input, len,
|
||||
$this->adoParameterType = 130;
|
||||
$p = $oCmd->CreateParameter('name',$this->adoParameterType,1,strlen($val),$val);
|
||||
//print $p->Type.' '.$p->value;
|
||||
$p = $oCmd->CreateParameter('name',$this->adoParameterType,1,$len,$val);
|
||||
|
||||
$oCmd->Parameters->Append($p);
|
||||
}
|
||||
$p = false;
|
||||
@@ -337,7 +353,7 @@ class ADORecordSet_ado extends ADORecordSet {
|
||||
|
||||
|
||||
// returns the field object
|
||||
function &FetchField($fieldOffset = -1) {
|
||||
function FetchField($fieldOffset = -1) {
|
||||
$off=$fieldOffset+1; // offsets begin at 1
|
||||
|
||||
$o= new ADOFieldObject();
|
||||
@@ -587,6 +603,16 @@ class ADORecordSet_ado extends ADORecordSet {
|
||||
ADOConnection::outp( '<b>'.$f->Name.': currency type not supported by PHP</b>');
|
||||
$this->fields[] = (float) $f->value;
|
||||
break;
|
||||
case 11: //BIT;
|
||||
$val = "";
|
||||
if(is_bool($f->value)) {
|
||||
if($f->value==true) $val = 1;
|
||||
else $val = 0;
|
||||
}
|
||||
if(is_null($f->value)) $val = null;
|
||||
|
||||
$this->fields[] = $val;
|
||||
break;
|
||||
default:
|
||||
$this->fields[] = $f->value;
|
||||
break;
|
||||
@@ -599,7 +625,7 @@ class ADORecordSet_ado extends ADORecordSet {
|
||||
@$rs->MoveNext(); // @ needed for some versions of PHP!
|
||||
|
||||
if ($this->fetchMode & ADODB_FETCH_ASSOC) {
|
||||
$this->fields = &$this->GetRowAssoc(ADODB_ASSOC_CASE);
|
||||
$this->fields = $this->GetRowAssoc(ADODB_ASSOC_CASE);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user