RE: [PEAR] DSN hostspec problem

From: Date: Mon, 19 Apr 2004 08:44:48 +0000
Subject: RE: [PEAR] DSN hostspec problem
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-11949@lists.php.net to get a copy of this message
Do you have a TNS setup? I'm using DB with Oracle and my DSN is of the format: $dsn = 'oci8://user:pass@tns'; if 'db5.portalDomainName.com' is your TNS you might try creating a new one without periods? Maybe DB chokes on it. or it is a problem with the TNS istelf. Can you connect using this user/pass/tns using SQL+? Herman http://www.orafaq.com/error/ora-12154.htm -----Original Message----- From: Roger Spears [mailto:roger@bgnet.bgsu.edu] Sent: Sunday, April 18, 2004 22:32 To: Robert Munteanu; PEAR Mailing List Subject: Re: [PEAR] DSN hostspec problem Robert Munteanu wrote: > Hello, Roger > > First of all, don't call $db->disconnect() on error, because the $db is > a PEAR_Error and does not have the disconnect method. Please see > > http://pear.php.net/manual/en/package.database.db.intro-connect.php > for > the recommended way to handle an error. Thank you. I didn't realize this. > Second of all, there should be a database part in the DSN. You can find > a complete documentation of it here : > http://pear.php.net/manual/en/package.database.db.intro-dsn.php > Ok, I've adjusted my code and now I have this: $user = myUsername; // set to my user name $pass = myPassword; // set to my password $host = db5.portalDomainName.com; // this is the hostspec $dbname = myDB; // the name of my database $dsn = "oci8://$user:$pass@$host/$db_name"; It's still giving me the TNS error. I've tried just connection to the database without actually connecting to a specific table, and same thing, I get a TNS error. ocilogon(): _oci_open_server: ORA-12154: TNS:could not resolve service name Any further suggestions? TIA, Roger -- PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

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