Home >Backend Development >PHP Tutorial >请问,kohana框架下如何连接oracle数据库,谢谢

请问,kohana框架下如何连接oracle数据库,谢谢

WBOY
WBOYOriginal
2016-06-23 14:10:16753browse

请问,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,
    )

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn