Oracle ODBC connection Problem
| From: | angel | Date: | Thu, 17 Jul 2003 13:48:49 +0000 |
| Subject: | Oracle ODBC connection Problem | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-29301@lists.php.net to get a copy of this message | ||
i'm trying to connect to a oracle database using the odbc driver with the
followin script:
----------------------------------------------------------------------------
---------
<?php $user="user"; $upasswd="password"; $dsn = "dsn";
$query = "select sysdate from dual"; print "<p>query is:
<code>$query</code><br>"; $conn = odbc_pconnect($dsn,
$user,$upasswd );
if (!$conn) { print "Connection failed\n</html>";
exit; } if ($result = odbc_Exec($conn, $query)) { print
"Query returned : " . odbc_num_rows($result) . " rows";
odbc_result_all($result, "border = 1"); }?>
----------------------------------------------------------------------------
---------and received the following error: Warning: SQL error:
[Microsoft][ODBC driver for Oracle][Oracle]ORA-12154: TNS:could not resolve
service name, SQL state 08001 in SQLConnect in c:\php\files\p.php on line
11how can i make this script work perfectly?