Subject: Connecting to oracle from PHP
Posted By: paragajoshi Post Date: 11/13/2003 4:09:37 AM
hi,
I am trying to connect to oracle 9i using PHP. I am using ADODB for the same.
Versions:
Oracle 9i
PHP 4.3.4
ADODB 4.0.3
Window 2000 Professional
IIS 5

I have extracted the ADODB zip file on the C Drive.

The part of the code is as follows
<?php
include('C:\adodb\adodb.inc.php');
include('C:\adodb\tohtml.inc.php');

$db = ADONewConnection('oci8po');

$db->PConnect('','PHPUser','PHPUser','OracleServer');

?>

Following are the error messages that i am getting when i execute the page.

Notice: Use of undefined constant OCI_COMMIT_ON_SUCCESS - assumed 'OCI_COMMIT_ON_SUCCESS' in C:\adodb\adodb.inc.php on line 3197

Fatal error: Call to undefined function: ociplogon() in C:\adodb\drivers\adodb-oci8.inc.php on line 136

My oracle server is on the different machine.
I am able to connect to the server from my machine using SQLPLUS

Could somebody please help me ??

thanks and regards
Parag Joshi

Reply By: nikolai Reply Date: 11/13/2003 9:48:49 PM
Okay, I've got a few questions for you:

Why are you connecting to Oracle through ADO?  Have you tried accessing it via the Oracle 9 PHP extension?
  http://www.php.net/oracle

Where did you get your ADODB php library from?  Have you read through its documentation to figure out how you're supposed to use it?

If you're including a library file that complains about undefined constants, then my hunch is that you should be including a different file that defines all the constants needed by the library file.  Well, either that or you're supposed to define all the constants yourself.  Whatever the case, the answer should be in the documentation for your ADODB library.

Also, your error message suggests that you're using the Oracle 8 call interface, but you're using oracle 9.  I've never used PHP with Oracle, so I can't say for sure, but you'll probably get better results by making sure all your versions match up.


Take care,

Nik
http://www.bigaction.org/

Go to topic 6316

Return to index page 1006
Return to index page 1005
Return to index page 1004
Return to index page 1003
Return to index page 1002
Return to index page 1001
Return to index page 1000
Return to index page 999
Return to index page 998
Return to index page 997