Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter and Oracle XE connection help me with a small working example please..
#2

[eluser]manton[/eluser]
I already got it.

First the database config is correct for a localhost.

2nd the model is here:
Code:
<?php
class Ocimod  extends Model {
    function Ocimod()
    {  
        parent::Model();
    }

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

3rd the controller
Code:
<?php
class Welcome extends Controller {

    function Welcome()
    {
        parent::Controller();
        
    }
    
    function index()
  {
    $query = $this->Ocimod->getEmployees();
    $data['que'] = $query->result();
    $data['numrows'] = $query->num_rows;
    $this->load->view('ociview',$data);
  }
}

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.

Cheers...


Messages In This Thread
CodeIgniter and Oracle XE connection help me with a small working example please.. - by El Forum - 12-09-2008, 07:08 AM



Theme © iAndrew 2016 - Forum software by © MyBB