Bug #16781 » class.ux_t3lib_db.MSSQL.patch
class.ux_t3lib_db.php 2007-02-27 15:27:54.000000000 +0100 | ||
---|---|---|
|
||
// Removing all numeric/integer keys.
|
||
// A workaround because in ADOdb we would need to know what we want before executing the query...
|
||
// fe@studioneun.de: MSSQL does not support ADODB_FETCH_BOTH and always returns an assoc array
|
||
// instead. So we don't need to remove anything.
|
||
if (is_array($output)) {
|
||
foreach($output as $key => $value) {
|
||
if (!$this->runningADOdbDriver('mssql')) {
|
||
foreach($output as $key => $value)
|
||
if (is_integer($key)) unset($output[$key]);
|
||
elseif($value===' ' && $this->runningADOdbDriver('mssql')) $output[$key]=''; // MSSQL does not know such thing as an empty string. So it returns one space instead, which we must fix.
|
||
}else{
|
||
// MSSQL does not know such thing as an empty string. So it returns one space instead, which we must fix.
|
||
foreach($output as $key => $value)
|
||
if($value===' ') $output[$key]='';
|
||
}
|
||
}
|
||
}
|
||
... | ... | |
|
||
// Removing all assoc. keys.
|
||
// A workaround because in ADOdb we would need to know what we want before executing the query...
|
||
// fe@studioneun.de: MSSQL does not support ADODB_FETCH_BOTH and always returns an assoc array
|
||
// instead. We need to convert.
|
||
if (is_array($output)) {
|
||
$arrKey = 0;
|
||
foreach($output as $key => $value) {
|
||
if (!is_integer($key)) unset($output[$key]);
|
||
elseif($value===' ' && $this->runningADOdbDriver('mssql')) $output[$key]=''; // MSSQL does not know such thing as an empty string. So it returns one space instead, which we must fix.
|
||
if (!is_integer($key) && !$this->runningADOdbDriver('mssql')){
|
||
unset($output[$key]);
|
||
}else{
|
||
unset($output[$key]);
|
||
$output[$arrKey] = $value;
|
||
if ($value===' ') $output[$arrKey]=''; // MSSQL does not know such thing as an empty string. So it returns one space instead, which we must fix.
|
||
$arrKey++;
|
||
}
|
||
}
|
||
}
|
||
}
|
||