Re: DSN hostspec problem
| From: | Justin Patrin | Date: | Mon, 19 Apr 2004 18:11:29 +0000 |
| Subject: | Re: DSN hostspec problem | ||
| References: | 1 2 3 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-11954@lists.php.net to get a copy of this message | ||
Roger Spears wrote:
Robert Munteanu wrote:You may want to look at adding a full Oracle connectuon string to your DSN or setting up a tnsnames file. See this bug report for an example of a possible connecitons string (note: there are lots of variations...). http://pear.php.net/bugs/bug.php?id=700 -- paperCrane <Justin Patrin>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.phpOk, 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