Welcome Guest, Not a member yet? Register   Sign In
Oracle query problem
#1

[eluser]Unknown[/eluser]
Hello,

I've download version 1.5.4 and am having some problems executing Oracle queries. I have Apache 2.2 and Oracle 10g (including the instantclient_10_2 directory and proper pathing) all local on a Vista machine. Note that I am able to use oci_connect and run a query that way but I would really like to use the built in functionality of the framework.

Note my connection to the database works using load->database, it's when it hits the query I get an error. I'm sure I just have something configured wrong but being new to PHP and frameworks I'm stumped.

Here are are my DB settings:
$active_group = "default";

$db['default']['hostname'] = "//localhost/XE";
$db['default']['username'] = "dev";
$db['default']['password'] = "dev";
$db['default']['database'] = "";
$db['default']['dbdriver'] = "oci8";
$db['default']['dbprefix'] = "";
$db['default']['active_r'] = TRUE;
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";

Here is my simple PHP code:
$this->load->database();
$query = $this->db->query("select 1 from dual");

This is the error I get (line 69 is the $query = ...)

A PHP Error was encountered
Severity: Notice
Message: Undefined property: CI_Loader::$db
Filename: views/welcome_message.php
Line Number: 69

Thanks in advance for any help.

Mike




Theme © iAndrew 2016 - Forum software by © MyBB