Welcome Guest, Not a member yet? Register   Sign In
HELP!!! Connecting to Oracle 9i
#1

[eluser]mhel_dc[/eluser]
Code:
I'm using CI 1.7.2 and I'm trying to connect to Oracle 9i server I've added new database information for oracle since my default database is MySQL:

In my database.php

$active_group = "default";
$active_record = TRUE;

$db['default']['hostname'] = "localhost";
$db['default']['username'] = "user";
$db['default']['password'] = "password";
$db['default']['database'] = "db";
$db['default']['dbdriver'] = "mysql";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";

$ora['ora9']['hostname'] = "OraSvr";
$ora['ora9']['username'] = "orauser";
$ora['ora9']['password'] = "orapwd";
$ora['ora9']['database'] = "";
$ora['ora9']['dbdriver'] = "oci8";
$ora['ora9']['dbprefix'] = "";
$ora['ora9']['pconnect'] = TRUE;
$ora['ora9']['db_debug'] = TRUE;
$ora['ora9']['cache_on'] = FALSE;
$ora['ora9']['cachedir'] = "";
$ora['ora9']['port']     = 1522;


In my controller:

<?php
    class test extends Controller
    {
        function test(){
            parent::Controller();
            $this->load->database('ora9',TRUE);
        }
        
        function index(){
        
            $qry        =   "Select Count(*) RsCount from SvrCatalog.TableName";
            $this->ora->query($qry);
            
            foreach($this->ora->result_array() as $row){
                echo $row['RsCount'];
            }
        }
    }
?>

When I tried to connect...

This came out :


An Error Was Encountered

You have specified an invalid database connection group.


I can't figure out what went wrong.... Please help.


Messages In This Thread
HELP!!! Connecting to Oracle 9i - by El Forum - 11-04-2009, 04:12 AM
HELP!!! Connecting to Oracle 9i - by El Forum - 11-04-2009, 04:42 AM
HELP!!! Connecting to Oracle 9i - by El Forum - 11-04-2009, 05:19 PM
HELP!!! Connecting to Oracle 9i - by El Forum - 11-04-2009, 07:35 PM
HELP!!! Connecting to Oracle 9i - by El Forum - 12-15-2009, 01:09 AM
HELP!!! Connecting to Oracle 9i - by El Forum - 12-15-2009, 01:11 AM
HELP!!! Connecting to Oracle 9i - by El Forum - 12-15-2009, 02:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB