• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CodeIgniter and Oracle XE connection help me with a small working example please..

Please anybody can shed me some light how to have a connection between CI 1.7 and oracle XE. At least to print_r the employees table in HR schema. I have tried many times following the CI database manipulation, doesn't work.

At least you can help me with the following:

the database config.

I already have like this one:
$db['default']['hostname'] = "//";
$db['default']['username'] = "HR";
$db['default']['password'] = "HR";
$db['default']['database'] = "";
$db['default']['dbdriver'] = "oci8";
is that correct for a localhost?

example of a model

example of a controller

that shows print_r the employees table HR database in oracle XE

Thanks in adnvace

I already got it.

First the database config is correct for a localhost.

2nd the model is here:
class Ocimod  extends Model {
    function Ocimod()

    function getEmployees()
    return $this->db->query("SELECT * FROM EMPLOYEES");

3rd the controller
class Welcome extends Controller {

    function Welcome()
    function index()
    $query = $this->Ocimod->getEmployees();
    $data['que'] = $query->result();
    $data['numrows'] = $query->num_rows;

Why mine was not working for all this time coz I dit not use uppercase for the first letter of the ocimodel. I put it like this
$query = $this->ocimod->getEmployees();

I did not realize that then I assumed the problem is in the connection, since in this forum not so many said succes about CI and codeigniter. Now I know CI is case sensitive and I have to be careful.


Hey manton,

did this actually work for you? I tried it on OracleXE as well, and it gives me that same exhausting error
A PHP Error was encountered

Severity: Warning

Message: ocifetchinto() [function.ocifetchinto]: ORA-24374: définition non exécutée après extraction ou exécution et extraction

Filename: oci8/oci8_result.php

Line Number: 155

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.