Re: Remote Oracle Connection
| From: | Steve Farmer | Date: | Mon, 05 Feb 2001 08:46:35 +0000 |
| Subject: | Re: Remote Oracle Connection | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-6390@lists.php.net to get a copy of this message | ||
Hi Doug,
This works for me..
putenv("ORACLE_SID=MYINSTANCE");
$uid = "MYUSERID";
$pwd = "MYUSERPASSWD";
$inst = "MYINSTANCE";
$conn = ocilogon($uid,$pwd,"$inst");
if(!$conn):
echo "unable to connect to database";
ocilogoff($conn);
endif;
$query= "alter session set NLS_DATE_FORMAT = 'DD-MON-YYYY'";
$curs = ociparse($conn,$query) or die( "Unable to parse query" );
ociexecute($curs) or die( "Unable to execute query" );
HTH
Steve
At 11:49 PM -0600 4/2/01, Doug Schasteen wrote:
Am I blind? Or is there no support with the regular oracle functions to connect to a database that is hosted on another machine? The manual has this: $conn = Ora_Logon(username, password); but I don't see anywhere to put the host string. - Doug Schasteen-- --------------------------------------------------- "Minds are like parachutes, they work best when open" Support free speech; visit http://www.efa.org.au/ Heads Together Systems Pty Ltd http://www.hts.com.au Email: hts@hts.com.au Tel: 612 9982 6767 Fax: 612 9981 3081