2016-07-29 112 views
0

我在Oracle和fuelphp,簡單的問題,新的,如何設置Oracle數據庫連接fuelphp框架,文件只針對MySQL和PostgreSQL:如何連接加速器與oracle?

// a MySQL driver configuration 
'development' => array(
'type'   => 'mysqli', 
'connection'  => array(
    'hostname'  => 'localhost', 
    'port'   => '3306', 
    'database'  => 'fuel_db', 
    'username'  => 'your_username', 
    'password'  => '[email protected]', 
    'persistent'  => false, 
    'compress'  => false, 
), 
'identifier'  => '`', 
'table_prefix' => '', 
'charset'  => 'utf8', 
'enable_cache' => true, 
'profiling'  => false, 
'readonly'  => false, 
), 

// a PDO driver configuration, using PostgreSQL 
'production' => array(
'type'   => 'pdo', 
'connection'  => array(
    'dsn'   => 'pgsql:host=localhost;dbname=fuel_db', 
    'username'  => 'your_username', 
    'password'  => '[email protected]', 
    'persistent'  => false, 
    'compress'  => false, 
), 
'identifier'  => '"', 
'table_prefix' => '', 
'charset'  => 'utf8', 
'enable_cache' => true, 
'profiling'  => false, 
'readonly'  => array('slave1', 'slave2', 'slave3'), 
) 

如何與Oracle連接?謝謝

回答

0

來自PostgreSQL PDO例如工作你貼我也試試這個:

'production'  => array(
'type'   => 'pdo', 
'connection'  => array(
    'dsn'   => 'oci:dbname=//hostname:port/database', 
    'username'  => 'your_username', 
    'password'  => '[email protected]', 
    'persistent'  => false, 
    'compress'  => false, 
), 
'identifier'  => '"', 
'table_prefix' => '', 
'charset'  => 'utf8', 
'enable_cache' => true, 
'profiling'  => false, 
'readonly'  => false 
) 

只要確保你已經correctly installed & configured PHP的OCI驅動程序。