Re: [DB] DSN problems with Oracle

From: Date: Thu, 21 Aug 2003 15:00:16 +0000
Subject: Re: [DB] DSN problems with Oracle
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-7331@lists.php.net to get a copy of this message
In response to suggestions I got from phpbuilder.com, I tried changing my DSN to "oci8://<username>:<pass>@<tnsname>", but I still get the same error. Are there any environment variables that may need set in order for PEAR::DB to find the tnsnames.ora file? If so, where would I set them? Thanks! Jason :) In article <jkcarter-1F2C92.15235220082003@pb1.pair.com>, jkcarter@uiuc.edu (Jason K. Carter) wrote: > I am having difficulty connecting to a remote Oracle database using PEAR > DB. Every time I run my code, I get a "no such database" error. Here > is the code: > > <?php > require_once 'DB.php'; > > $dsn="oci8://<username>:<pass>@<host_ip>:1521/<service > name>"; > > $db = DB::connect($dsn); > > if (DB::isError($db)) { > die ($db->getMessage()); > } > ?> > > I can connect to the database fine using sqlplus and a tns name. Is > there something I should change in my DSN connection string to help it > find the correct database on the server? > > Thank you! > Jason :)

« previous php.pear.general (#7331) next »