...

View Full Version : Re:Problem connecting to the remote oracle using PHP and ADODB



PASHA_SANYAL
11-05-2007, 08:50 AM
Hi All,
I really need help on the following code :( . I'm connecting to remote oracle with the following code. Can you tell me what's going wrong. I am not being able to connect to the oracle.:confused:


$DSN="oci8://".USERNAME.":".PASSWORD."@".HOST."/".SID;
$DB=NewADOConnection($DSN);
$DB->debug = 1;


Then I am using this code:

$res = $DB->Execute($sql) or die($DB->ErrorMsg());

It is showing error:
Fatal error: Call to undefined method stdClass::Execute()

I would be greatly obliged if you can share me some light on this...

Thanks in advance,

Mwnciau
11-05-2007, 09:01 AM
$DB=NewADOConnection('oracle');
$db->Connect($host, $user, $password, $database);
$res = &$db->Execute($sql);

Explained here (http://www.databasejournal.com/sqletc/article.php/2222651)

PASHA_SANYAL
11-05-2007, 12:04 PM
$DB=NewADOConnection('oracle');
$db->Connect($host, $user, $password, $database);
$res = &$db->Execute($sql);

Explained here (http://www.databasejournal.com/sqletc/article.php/2222651)

This is ok when you are connecting to the local database but not the remote database. For remote database you must require the host and the SID. Without it the connection cannot happen. Anyway thanks for the posting, I really appreciate it. :thumbsup:

PASHA_SANYAL
11-06-2007, 11:48 AM
Hi all,

I really need some help on this. Can't anyone help me out on this?? :(



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum