![]() |
Connecting to Oracle Database - 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: Connecting to Oracle Database (/showthread.php?tid=34236) |
Connecting to Oracle Database - El Forum - 09-23-2010 [eluser]imorris[/eluser] I need some assistance getting connected to an Oracle database. I have the Oracle 10g client installed on my machine and have been able to connect to the database in other projects (like VB Scripting). I get an error when the page loads that looks like this: Code: A PHP Error was encountered Here is my dbconfig. Code: $active_group = "default"; Connecting to Oracle Database - El Forum - 09-23-2010 [eluser]imorris[/eluser] I figured out that I need to uncomment "OCI8" in php.ini. And now I'm getting a different error: Code: A Database Error Occurred Connecting to Oracle Database - El Forum - 09-23-2010 [eluser]imorris[/eluser] I fixed it. I had to restart Apache after uncommenting php.ini. I verified that my tnsnames.ora was correct. I also changed my dbconfig to look like this: Code: $db['default']['hostname'] = "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=<IPADDRESS>)(PORT=<PORT_NUMBER>))(CONNECT_DATA=(SERVICE_NAME = <INSTANCE>)))"; Connecting to Oracle Database - El Forum - 09-23-2010 [eluser]imorris[/eluser] Ok, ran into last issue. How do I specify the name of the database? My queries are erroring out and I think it's because the database name isn't specified anywhere. The Wiki says that 'database' is ignored when using oci8. Connecting to Oracle Database - El Forum - 09-23-2010 [eluser]imorris[/eluser] Nevermind. All is well now. Turns out (from reading this post: http://ellislab.com/forums/viewthread/161482/) that the query becomes case sensitive through Active Records. I adjusted my case and everything's better. |