Jump to content

Archived

This topic is now archived and is closed to further replies.

everbright

Problem Connecting To Oracle Using Adodb

Recommended Posts

Hi all,

I'm using PHP 5.1.4 and am now trying to connect to an Oracle database using ADODB library. Here's the sample code I used to test out:

[code]include("./adodb/adodb-exceptions.inc.php");
include("./adodb/adodb.inc.php");
$DB = NewADOConnection('oci8');  
$DB->PConnect("lportal", "lportaldbuser", "lportalpw");

try {  
    
    $DB->Execute("select * from wiki_user");
} catch (exception $e) {    
    print_r($e);
}

print "Hi";[/code]

I tried using Oracle SQL Plus to connect with the same credentials and it works there.

Here's what I got when I ran the script:

[code]Notice: Use of undefined constant OCI_COMMIT_ON_SUCCESS - assumed 'OCI_COMMIT_ON_SUCCESS' in E:\Miscellaneous\MediaWiki\adodb\adodb.inc.php on line 3930[/code]

Note that it didn't print "Hi", meaning that for some reason, it stopped execution somewhere before that and refused to spit out any more helpful error messages :-(

By commenting out and gradually uncommenting the lines, I found that the error happens with the line:

[code]$DB->PConnect("lportal", "lportaldbuser", "lportalpw");[/code]

Any ideas what I might have missed out here? How can I get more info on this error? Maybe some configuration with ADODB?

Thanks in advance for any suggestions!

Share this post


Link to post
Share on other sites

×

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.