Hi, everyone.
Here I am, long time reader, first time poster, asking for your kind help with this rare problem.
After a week pulling my hair out, I’ve finally made the oci8 library work with PHP 5.2.4. As I have the Oracle 8i Client 8.1.7.0.0, I had to download the Oracle 10g Instant Client, reconfigure my path variable, edit my registry malformed NLS_LANG variable, etc. (more info here: http://tinyurl.com/34nzlt, http://tinyurl.com/enrtj and here http://tinyurl.com/2a9wo4).
Now I’ve been able to query a table from my oracle DB directrly through a PHP script:
$db_conn = ocilogon("user", "passwd", 'SID');
$cmdstr = "select * from user_tables";
$parsed = ociparse($db_conn, $cmdstr);
ociexecute($parsed);
$nrows = ocifetchstatement($parsed, $results);
for ($i = 0; $i < $nrows; $i++ )
{
echo $results["TABLE_NAME"][$i];
echo number_format($results["TABLESPACE_NAME"][$i], 2);
}
But when I try to do a similar thing throu codeigniter, I get this output:
A PHP Error was encountered
Severity: Warning
Message: ocifetchinto() expects parameter 1 to be resource, null given
Filename: oci8/oci8_result.php
Line Number: 159
Any idea what could it mean? I’m thinking, some kind of incompatibility between the 8.1 and 9i version of my DB.
my config\database.php look like this:
$db['default']['hostname'] = "SID";
$db['default']['username'] = "user";
$db['default']['password'] = "passwd";
$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'] = "";
and my model:
class Ora extends Model {
function Ora()
{ parent::Model();
$this->load->database('default',TRUE); }
function get_sel()
{ $query = $this->db->getwhere('month',array('month >' => '06'));
return $query->result();}
}
after the ifrst error, it repeats this one several times:
A PHP Error was encountered
Severity: Notice
Message: Undefined property: stdClass::$nombre_mes
Filename: libraries/Loader.php(647) : eval()‘d code
Line Number: 11
Now, the interesting thing is that it repeats this second error the same number of times as rows it should have returned, so as far as I can tell, it’s getting the result; it just can’t show it.
any ideas? thanks!
