For you Internet Explorer 6 users out there: If you’re using an older version of Internet Explorer (6 or lower), chances are you’re doing it because you’ve no choice but to do so. I appreciate your situation—I really do. However, I can’t really allow you the same freedom I would allow others on this site because Internet Explorer 6 is unsafe. So, if you can’t use Google Chrome Frame, update your version of Internet Explorer, or download Firefox, I’m going to have to present to you the bare-bones, vanilla version of this website. Since the content here is awesome, you should still be able to enjoy yourself. Cheers!

Home
Where the heart is.

CodeIgniter and Oracle

I’ve been writing a lot of code lately and, as a result, my creativity is being sucked up by problem solving. I hope to write something more interesting the next time around.

While trying to figure out how to get CodeIgniter to talk to an Oracle database, I came across this great post which covers in part some of the items I mentioned in my previous Oracle-related post. So I got through it all, followed the instructions, but still couldn’t connect to the database through CodeIgniter — that is, not until I read up on Easy Connect Naming. Here’s what my database configuration settings look like:

  1. $db[‘default’][‘hostname’] = "HOST/SERVICE_NAME";
  2. $db[‘default’][‘username’] = "USERNAME";
  3. $db[‘default’][‘password’] = "PASSWORD";
  4. $db[‘default’][‘database’] = "";
  5. $db[‘default’][‘dbdriver’] = "oci8";
  6. $db[‘default’][‘dbprefix’] = "";
  7. $db[‘default’][‘pconnect’] = TRUE;
  8. $db[‘default’][‘db_debug’] = TRUE;
  9. $db[‘default’][‘cache_on’] = FALSE;
  10. $db[‘default’][‘cachedir’] = "";
  11. $db[‘default’][‘char_set’] = "utf8";
  12. $db[‘default’][‘dbcollat’] = "utf8_general_ci";

You can pull all of the information you need out of the connection string that usually appears in your tnsnames.ora file (if you’ve got one, that is).