![]() |
oracle problem? 'ocifetchinto() expects parameter 1 to be resource, null given' ? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: oracle problem? 'ocifetchinto() expects parameter 1 to be resource, null given' ? (/showthread.php?tid=3798) |
oracle problem? 'ocifetchinto() expects parameter 1 to be resource, null given' ? - El Forum - 10-22-2007 [eluser]Unknown[/eluser] 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: Code: $db_conn = ocilogon("user", "passwd", 'SID'); 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: Code: $db['default']['hostname'] = "SID"; and my model: Code: class Ora extends Model { 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! oracle problem? 'ocifetchinto() expects parameter 1 to be resource, null given' ? - El Forum - 10-24-2007 [eluser]mhyk[/eluser] i think it's a oci8 bug. I also have a problem with that. oracle problem? 'ocifetchinto() expects parameter 1 to be resource, null given' ? - El Forum - 10-25-2007 [eluser]crossett[/eluser] Move the line of code that reads "$RES->num_rows = $RES->num_rows();" below the if block in system/database/DB_driver.php. It is around line 325. $driver = $this->load_rdriver(); $RES = new $driver(); $RES->conn_id = $this->conn_id; $RES->result_id = $this->result_id; if ($this->dbdriver == 'oci8') { $RES->stmt_id = $this->stmt_id; $RES->curs_id = NULL; $RES->limit_used = $this->limit_used; } $RES->num_rows = $RES->num_rows(); oracle problem? 'ocifetchinto() expects parameter 1 to be resource, null given' ? - El Forum - 09-12-2008 [eluser]411161[/eluser] I tried that: $driver = $this->load_rdriver(); $RES = new $driver(); $RES->conn_id = $this->conn_id; $RES->result_id = $this->result_id; //$RES->num_rows = $RES->num_rows(); if ($this->dbdriver == 'oci8') { $RES->stmt_id = $this->stmt_id; $RES->curs_id = NULL; $RES->limit_used = $this->limit_used; } //as411161 9/12/2008 $RES->num_rows = $RES->num_rows(); Did not work for me. oracle problem? 'ocifetchinto() expects parameter 1 to be resource, null given' ? - El Forum - 09-25-2008 [eluser]bakazero[/eluser] @crossett Thx! It's works for me like the magic! @summer Student Thx for you too! I'm using your database-config right now... hmm... Why not works for you? Btw, I'm using codeigniter 1.6.3.. maybe you need upgrade your CI first... |