Rumah >pembangunan bahagian belakang >tutorial php >请问,kohana框架下如何连接oracle数据库,谢谢
请问,kohana框架下如何用框架里面的pdo连接oracle数据库,谢谢
用原生态的tns可以
搞定
;extension=php_pdo_oci.dll
;extension=php_pdo_oci8.dll
这2个服务都要打开
用Kohana框架下的Pdo_oci连接代码示例:
'test' => array
(
'type' => 'PDO',
'connection' => array(
/**
* The following options are available for MySQL:
*
* string hostname server hostname, or socket
* string database database name
* string username database username
* string password database password
* boolean persistent use persistent connections?
* array variables system variables as "key => value" pairs
*
* Ports and sockets may be appended to the hostname.
*/
'dsn' => 'oci:dbname=//xxx.xxx.xxx.xx',
'hostname' => 'hostname',
'database' => 'database name',
'username' => 'username',
'password' => 'password',
'persistent' => FALSE,
),
'table_prefix' => '',
'charset' => 'gb2312',
'caching' => FALSE,
'profiling' => TRUE,
)