Subversion Repositories oidplus

Rev

Rev 783 | Rev 1050 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 783 Rev 861
Line 105... Line 105...
105
                $ret = odbc_fetch_object($this->res);
105
                $ret = odbc_fetch_object($this->res);
106
                if ($ret === false) $ret = null;
106
                if ($ret === false) $ret = null;
107
                if (!is_null($ret)) {
107
                if (!is_null($ret)) {
108
                        // ODBC gives bit(1) as binary, MySQL as integer and PDO as string.
108
                        // ODBC gives bit(1) as binary, MySQL as integer and PDO as string.
109
                        // We'll do it like MySQL does, even if ODBC is actually more correct.
109
                        // We'll do it like MySQL does, even if ODBC is actually more correct.
110
                        foreach ($ret as &$value) {
110
                        foreach ((array)$ret as &$value) {
111
                                if ($value === chr(0)) $value = 0;
111
                                if ($value === chr(0)) $value = 0;
112
                                if ($value === chr(1)) $value = 1;
112
                                if ($value === chr(1)) $value = 1;
113
                        }
113
                        }
114
                }
114
                }
115
 
115
 
116
                // Oracle returns $ret['VALUE'] because unquoted column-names are always upper-case
116
                // Oracle returns $ret['VALUE'] because unquoted column-names are always upper-case
117
                // We can't quote every single column throughout the whole program, so we use this workaround...
117
                // We can't quote every single column throughout the whole program, so we use this workaround...
118
                if ($ret) {
118
                if ($ret) {
119
                        foreach ($ret as $name => $val) {
119
                        foreach ((array)$ret as $name => $val) {
120
                                $ret->{strtoupper($name)} = $val;
120
                                $ret->{strtoupper($name)} = $val;
121
                                $ret->{strtolower($name)} = $val;
121
                                $ret->{strtolower($name)} = $val;
122
                        }
122
                        }
123
                }
123
                }
124
 
124