CodeIgniter Forums
Issues connecting to Oracle DB - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Issues connecting to Oracle DB (/showthread.php?tid=52916)



Issues connecting to Oracle DB - El Forum - 07-02-2012

[eluser]Unknown[/eluser]
Anybody know why i can get this to work in a simple php script but when I try to use it in CodeIgniter it doesn't work.

I get this error :
Message: oci_connect(): ORA-12154: TNS:could not resolve the connect identifier specified

Code:
$oracle_username = 'username';
  $oracle_password = 'password';
  $connection_string = 'dwprd';
  $oracle_connection = oci_connect($oracle_username, $oracle_password, $connection_string);
  
  if( ! $oracle_connection)
  {
   $error = oci_error();
   echo "owned";
   die();
  }
  else
  {
   echo "works";
  }