Jump to content

PHP & Oracle DB


Cendler85

Recommended Posts

Hi all,

 

I'm an italian programmer and i have a very big problem: i must connect to Oracle DB.

 

The error log is:

 

Warning: ocilogon() [function.ocilogon]: OCIEnvNlsCreate() failed. There is something wrong with your system - please check that ORACLE_HOME is set and points to the right directory in /var/www/phpnuke/html/modules/FAQ/index.php on line 266

Errore nella scelta del database

 

The code is:

 

  PutEnv("ORACLE_SID=XE");

  PutEnv("ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server");

  PutEnv("TNS_ADMIN=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/network/admin");

 

  $db = "XE";

 

  $sql = "SELECT * FROM DEFECT";

 

  $cn = OCILogon("smc","smc",$db)or die('Errore nella scelta del database');

       

  $stmt = OCIParse($cn,$sql) or die ("Couldn't parse statement.");

 

  OCIExecute($stmt) or die ("Couldn't execute query.");

 

   

    while (OCIFetchInto ($stmt, $row, OCI_ASSOC)) {

 

    print "ID: ".$row[iD]."<br>";

  }

 

 

  OCIFreeStatement($stmt);

  OCILogoff($cn);

 

 

Can you help me? I offer a ham on Christmas Time the first one that help me ;)

 

Thanks

Link to comment
Share on other sites

  • 2 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.