Welcome Guest, Not a member yet? Register   Sign In
Any Tutorials for Oracle and Codeigniter?
#1

[eluser]Unknown[/eluser]
Hi!

Is there even a tutorial on the basics on how to use Oracle and Codeigniter? I'm really struggling looking for answers but to no luck. I've enabled my oci8 driver and such. I also am able to connect to my local database but is seems the typical function i used (query(), num_rows()) is not working. I just want to simply do this:

$dcv2DB = $this->load->database('dcv2', TRUE);

$sqlSource = 'SELECT SYSDATE FROM DUAL;';
$result = $dcv2DB->simple_query($sqlSource);
echo $result->num_rows();
$dcv2DB.close();

Expecting a 1 but i always get:

Fatal error: Call to a member function num_rows() on a non-object in C:\xampp\htdocs\CPM\system\application\models\DbSyncModel.php on line 16

Please help. Sad
#2

[eluser]regal2157[/eluser]
simple_query only returns true/false. true/false will not have a number of rows...

Just use the ->query() function.




Theme © iAndrew 2016 - Forum software by © MyBB