Welcome Guest, Not a member yet? Register   Sign In
oracle db connection
#1

Currently I'm working with oracle db using codeigniter. I'm newbie to this db, when i try to make the connection. I got this error.
A PHP Error was encountered
Code:
Severity: Notice
Message: Use of undefined constant OCI_COMMIT_ON_SUCCESS - assumed 'OCI_COMMIT_ON_SUCCESS'
Filename: database/DB.php
Line Number: 144

I've already enable extension in php.ini
Code:
;extension=php_mysqli.dll
extension=php_oci8.dll      ; Use with Oracle 10gR2 Instant Client
;extension=php_oci8_11g.dll  ; Use with Oracle 11gR2 Instant Client

Below is my code for database.php :
Code:
$active_group = 'default';
$active_record = TRUE;
$db['default']['hostname'] = 'xxx.xxx.x.xx';
$db['default']['username'] = 'xxxx';
$db['default']['password'] = 'xxxx';
$db['default']['database'] = '';
$db['default']['dbdriver'] = 'oci8';
$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';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;

Below is the code at controller :
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Welcome extends CI_Controller {


   function __construct()  {
           parent::__construct();
   }

   function index()        {
           $this->db = $this->load->database('default',TRUE);

           if(!empty($this->db))
                   echo "Connected!"."\n";
           else
                   echo "Closed"."\n";
   }
}

I've been stuck on this problem almost 2 weeks. I also already searched the solution but nothing's work. can you help me?
Reply
#2

It seems your oracle setup is not completed.

I'm not sure, but this PDF http://www.oracle.com/technetwork/topics...98250.html may help you.
Reply
#3

(11-26-2015, 12:09 AM)kenjis Wrote: It seems your oracle setup is not completed.

I'm not sure, but this PDF http://www.oracle.com/technetwork/topics...98250.html may help you.

can you guide me how to setup the oracle?
Reply




Theme © iAndrew 2016 - Forum software by © MyBB