ThinkPHP 3.2.2 用DSN方式连接不上Oracle 11G问题
系统环境: Windows 2003 R2
Server: Microsoft-IIS 6.0
PHP: 5.3.28
Oracle Server: 11G
Oracle Client: instantclient 11.2
ThinkPHP:3.2.2
File:Oracle.class.php
Line:50
Desc:连接Oracle时没有加入主机名和端口号$this->linkID[$linkNum] = $conn($config['username'], $config['password'],$config['database']);//modify by wyfeng at 2008.12.19
修改为:$this->linkID[$linkNum] = $conn($config['username'], $config['password'],$config['hostname'].':'.$config['hostport'].'/'.$config['database']);
Line:214
Desc:$val键名大小写问题造成无法给$info赋值if($result) {<br>
foreach ($result as $key => $val) {<br>
$info[strtolower($val['column_name'])] = array(<br>
'name' => strtolower($val['column_name']),<br>
'type' => strtolower($val['data_type']),<br>
'notnull' => $val['notnull'],<br>
'default' => $val['data_default'],<br>
'primary' => $val['pk'],<br>
'autoinc' => $val['pk'],<br>
);<br>
}<br>
}
修改为:if($result) {<br>
foreach ($result as $key => $val) {<br>
$info[$val['COLUMN_NAME']] = array(<br>
'name' => $val['COLUMN_NAME'],<br>
'type' => $val['DATA_TYPE'],<br>
'notnull' => $val['NOTNULL'],<br>
'default' => $val['DATA_DEFAULT'],<br>
'primary' => $val['PK'],<br>
'autoinc' => $val['PK'],<br>
);<br>
}<br>
}
当前这种修改方式感觉有欠缺,由于项目时间紧迫,没有做其它测试,请官方重视解决一下,感谢你们的辛勤劳动,提供这么好用的框架,谢谢
Oracle.class.zip ( 3.49 KB 下载:33 次 )
AD:真正免费,域名+虚机+企业邮箱=0元